appfeel / node-pushnotifications

Push notifications for GCM, APNS, MPNS, AMZ (automatic detection from device token)
MIT License
534 stars 126 forks source link

Get newly updated Registration IDs for FCM along with other notification service providers #77

Closed niranjan-unimity closed 6 years ago

niranjan-unimity commented 6 years ago

In android(GCM/FCM) as everybody knows the registration IDs will be updated every now and then by google server. To keep track of it and update them in our application server we should have to read the registration_id parameter inside results array, from the response and update it to the application server accordingly. We can know what's the old registration ID and what's the updated ID by matching the index of results array with that of the index of registration IDs array which we'll send. This is possible when we send only GCM IDs but it's not possible if I send GCM with other notification service providers, as the index of the request registration ID can not be matched with the response. There should be a field inside the message object specifying the old registration ID for GCM.

alex-friedl commented 6 years ago

Hello @niranjan-unimity, thank you for your idea and PR https://github.com/appfeel/node-pushnotifications/pull/78. I added some feedback to your PR, feel free to amend and discuss :)

alex-friedl commented 6 years ago

Closed after merge of PR #78.

Thank you for your contribution! :)