angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

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

Open woutersteven opened this issue 2 years ago • 1 comments

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?

woutersteven avatar Aug 12 '23 00:08 woutersteven

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

google-oss-bot avatar Aug 12 '23 00:08 google-oss-bot