简体   繁体   中英

Can FCM push notifications in Electron App

I'm trying to send notifications from Firebase Cloud Messaging (FCM) to a window app (window form for example) but it doesn't seem to be possible (since fcm only supports android/ios/webapp, for here and here ).

So trying building Electron app to be able to receive and display notifications from fcm (slack is built from electron js and also displays notifications, here ), and found the electron-push-receiver allowing it to receive notifications from FCM

But it seems that there is no update for a long time, so there is a issue#80

Now is it possible to build electron application that can receive notifications from FCM?

Thank you very much!

I just implemented FCM in my Electron app earlier today by following the guide here: https://github.com/CydeSwype/electron-fcm-demo

Screenshot of FCM working in an Electron app

I was skeptical at first as well, given that the repo hasn't been updated in a while, but was pleasantly surprised that it still works. If you have any further questions, go ahead and I'll try to help :)

I also got this working with electron-push-receiver, though I had to do a workaround for more recent versions of Electron .

I looked at the firebase-admin.messaging Node package but that is only for privileged environments.

The HTTP 503 issue you linked it seems was just another outage that has been resolved; I can still register for push notifications with this setup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM