angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.66k stars 2.19k forks source link

httpsCallable and fcm triggers FCM error when SW is in a custom location and getToken is not called yet #3418

Open woutersteven opened 1 year ago

woutersteven commented 1 year ago

Version info

Angular 16.2, Firebase 9.23, AngularFire 7.6.1. Ionic 7.2.3

How to reproduce these conditions

Angular has it's own SW (Service Worker), to also use FCM I use a 2nd SW with a different scope, which works fine. The FCM SW is located in a separate location (not in the root).

When using httpsCallable the Cloud function gets called, but an error is triggered if getToken for FCM is not called first. The error message is: "A bad HTTP response code (404) was received when fetching the script." which refers to firebase-messaging-sw.js not being in the root of the project.

How can I register the firebase-messaging-sw.js ServiceWorker in a custom location? or prevent AngularFire from looking in the default location?

google-oss-bot commented 1 year ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.