Need help in Firebase Cloud messaging(Latest SDK) in Electron.js for web push notification

69 views
Skip to first unread message

Amit Deshmukh

unread,
Jun 9, 2024, 8:41:18 PMJun 9
to Firebase Google Group

Hello All,

We are developing one desktop application in Electron.js as it is cross-platform support in Electron.js.
In that, we have to use FCM push notifications but we getting issues on the client side registering with FCM in Electron.js.
We are using Firebase npm in Electron.js (Client side) to register the device to FCM and get the FCM token but we are failing to receive the FCM token.

We are getting an error below when we try to get a token from FCM.
An error occurred while retrieving the token. Error: Messaging: We are unable to register the default service worker. Failed to register a ServiceWorker for scope ('file:///C:/firebase-cloud-messaging-push-scope') with a script ('file:///C:/firebase-messaging-sw.js'): An unknown error occurred when fetching the script. (messaging/failed-service-worker-registration).

Please help us to integrate FCM in the Electron.js desktop application with the latest FCM SDK. We are using NodeJS on the server side which is working fine but the client side (Electorn.js) is not working.

Reply all
Reply to author
Forward
0 new messages