ServiceWorker registration fails in Facebook/Instagram in-app browser on iOS
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- angular, firebase, typescript
- 領域
- frontend
研究方向
從 issue 中顯示的 messaging-service 初始化呼叫開始,並在 Facebook/Instagram 的 iOS 應用程式內瀏覽器中重現它。追蹤 navigator.serviceWorker 的存取方式;當 API 無法使用時初始化不再擲出錯誤,且已在支援的環境中驗證 push 行為,即表示完成。
由索引模型根據 Issue 內容生成。
描述
When using the Firebase Messaging service with Angular 19.1.4 in the Facebook/Instagram in-app browser on iOS devices, the following error occurs:
TypeError: undefined is not an object (evaluating 'navigator.serviceWorker.addEventListener')
Environment
- Platform: iOS
- Browser: Facebook/Instagram in-app browser
- Framework: Angular 19.1.4
- Dependencies:
- @angular/core: 19.1.4
- @angular/common: 19.1.4
- @angular/platform-browser: 19.1.4
- Service: Firebase Cloud Messaging
Technical Details
The error occurs during the messaging service initialization when attempting to add an event listener to the ServiceWorker. The specific line causing the issue is:
navigator.serviceWorker.addEventListener('message', e => messageEventListener(messaging as MessagingService, e));
Root Cause
The Facebook/Instagram in-app browser on iOS does not support or properly expose the ServiceWorker API, causing navigator.serviceWorker to be undefined. This issue persists even with the latest Angular 19 framework.
Impact
- Firebase Cloud Messaging service initialization fails
- Push notifications cannot be registered or received
- Affects only users accessing the Angular 19 application through Facebook/Instagram in-app browser on iOS devices
- 主要語言
- TypeScript
- 星號
- 7.8k
- 分支
- 2.2k
- 平均合併
- 2 天 21 小時
- 30 天內合併 PR
- 7
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
angular/angularfire 的其他 Issue
-
comp: schematics type: bug version: current (v17+)
難度 3/5 1-2 天 新手友好度 76/100
angular/angularfire#3768 · 1 則留言 ·
-
comp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 已指派 1 人 ·
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable 未關閉comp: core type: feature
angular/angularfire#3755 · 已指派 1 人 ·
-
comp: auth comp: ssr comp: zones type: bug version: current (v17+)
難度 3/5 1-2 天 新手友好度 76/100
angular/angularfire#3748 · 1 則留言 ·
-
難度 4/5 3-5 天 新手友好度 35/100
angular/angularfire#3737 · 1 則留言 · 22 個 reaction ·
查看 angular/angularfire 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 則留言 ·
-
external-issue to-triage
難度 2/5 1-3 小時 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
難度 2/5 半天 新手友好度 86/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
refactor
難度 2/5 1-3 小時 新手友好度 84/100