Eneris / push-receiver

A library to subscribe to GCM/FCM and receive notifications within a node process.
https://medium.com/@MatthieuLemoine/my-journey-to-bring-web-push-support-to-node-and-electron-ce70eea1c0b0
MIT License
16 stars 16 forks source link

Support FCM register using default VAPID #20

Closed tsightler closed 4 months ago

tsightler commented 4 months ago

The PR re-enables the ability to register using the default Firebase VAPID when no project specific VAPIDkey parameter is defined. This seems to be required for receiving messages from Android projects where it appears the default VAPID key is used. The issue here is in the registerFCM function, if you define applicationPubKey as the default VAPID, the registration will fail, however, if you simply exclude that parameter completely, the registration is successful and it appears to work with the default VAPID.

I have confirm that registration works with both my own project, and also with an external project that I do not control, although I have the required information to register. After doing this I was able to receive push notifications as with previous versions.

tsightler commented 4 months ago

Thanks for the changes, much cleaner!

Eneris commented 4 months ago

Clean the changes that are not needed anymore and we can merge it

tsightler commented 4 months ago

Let me know how that looks, should be down to the minimal set of changes. Thanks.

tsightler commented 4 months ago

Thanks for the merge and for maintaining this project!