Skip to content

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

Open
@woutersteven

Description

@woutersteven

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions