This is driving me crazy. A few weeks ago I added support for FCM push notifications and got it all working. Last week I noticed (via my test app) that it had stopped working. Through a long convoluted process I managed to get it all working again. This morning...installed my test app, the device retrieved a pushID, saved that pushID to my server and then successfully sent push notices to my device. I did some directly from my server and others from the FCM Console Notifications section - both were working.
Great...don't touch a thing...move on to next items to code.
I am working app registration features...so I uninstall my app and reinstall at which time the app receives a new pushID...same process as above, it saves the pushID to my server. But this time the message is sent but never arrives. I try again - same thing. Message successfully sent...but it never arrives.
object(stdClass)#4 (5) { ["multicast_id"]=> int(7727871665417217028) ["success"]=> int(1) ["failure"]=> int(0) ["canonical_ids"]=> int(0) ["results"]=> array(1) { [0]=> object(stdClass)#5 (1) { ["message_id"]=> string(35) "0:1498579447399689%94806eb594806eb5" } } }
Frustrated I leave my house, go run some errands and come back about 2.5 hours later and test again...this time the message fails to even send.
object(stdClass)#4 (5) { ["multicast_id"]=> int(4811433973238781554) ["success"]=> int(0) ["failure"]=> int(1) ["canonical_ids"]=> int(0) ["results"]=> array(1) { [0]=> object(stdClass)#5 (1) { ["error"]=> string(13) "NotRegistered" } } }
What am I missing here? It went from completely working....to sending successfully but not receiving....to not sending at all. Is there some kind of time/date stamp that expires per pushID? Does it take some time for pushIDs to register in the FCM Cloud before they can be used? Can they only be used once?
Each time I start my app it checks to see if the pushID has changed for the device, each time (simple stop/start...not a full uninstall/reinstall) I can see that the pushID is the same - it hasn't changed.
Pulling my hair out on this one.
PS: I am actually using the phonegap-plugin-push
plugin, not the cordova-plugin-fcm
. I don't have a high enough reputation yet to create new Tag words.