ServiceWorker registration fails in Facebook/Instagram in-app browser on iOS
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, firebase, typescript
- Domain
- frontend
Research direction
Start at the messaging-service initialization call shown in the issue and reproduce it in Facebook/Instagram's iOS in-app browser. Trace how navigator.serviceWorker is accessed; done means initialization no longer throws when the API is unavailable, with push behavior verified where supported.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 7.8k
- Forks
- 2.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 25
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from angular/angularfire
-
comp: compat comp: firestore comp: storage type: chore
Difficulty 4/5 3-5 days Newbie friendliness 48/100
angular/angularfire#3822 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
angular/angularfire#3800 · 1 reaction ·
Maintainers usually reply within 3 days
-
Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twiceMay be free again @armando-navarro claimed this 75 days ago, and no pull request is open. Opencomp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 1 assignee ·
Maintainers usually reply within 3 days
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachableMay be free again @armando-navarro claimed this 75 days ago, and no pull request is open. Opencomp: core type: feature
angular/angularfire#3755 · 1 assignee ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
angular/angularfire#3737 · 4 comments · 26 reactions ·
Maintainers usually reply within 3 days
All issues in angular/angularfire
Similar issues
-
bug parity
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
WenyuChiou/agent-board#1489 ·
Maintainers usually reply within 1 day
-
area: bazaar bug complexity: medium
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
accensa/x402-facilitator-stellar#779 ·
Maintainers usually reply within 1 day
-
bug good first issue P4 size:S web-ui
Difficulty 2/5 Half a day Newbie friendliness 85/100
josephfung/curia#2600 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cloudflare/partykit#444 ·