Closed alexislg2 closed 8 years ago
@alexislg2 you are receiving NotRegistered
because:
BroadcastReceiver
configured to receive com.google.android.c2dm.intent.RECEIVE
intentsIs it possible that you released updates to your app recently and that your app doesn't re-register after updating?
Hey thanks for your quick answer.
, the plugin has a service com.adobe.phonegap.push.PushInstanceIDListenerService that will listen for any changes on the registration ID and throw a new registration event.
Thanks
@alexislg2 are you registering every time the app is opened? That's very bad and could be the reason you are getting this error. You should not be registering unless the app is fresh-installed or updated, or the IDListenerService
invokes the registration service for some other reason.
Oh oh that's interesting. Actually this is the way the Phonegap/cordova Pushplugin is coded. I will tell the developers about that. Do you have a link to the documentation that says we should register only after APK updates?
Thanks
In Google's official GCM Client Demo App they register to GCM only when a new version of the application is installed on the device. Therefore I assume that's the best practice.
Check out this StackOverflow question which addresses this issue in regards to Cordova/PhoneGap.
I remember having similar problems with my app when I also re-registered devices every time the app was opened.
OK according to the SO post, it does not seem to be so bad to register at every start, just a waste of time and data I think.
@alexislg2 I recall having a similar issue where devices would not receive push notifications and I was able to solve it by not re-registering every time the app is restarted. I'd recommend avoiding it if you can, as it doesn't follow the GCM registration workflow:
- The client app obtains a registration token using the Instance ID API. The call to this API must have the authorized entity set to your app server's sender ID, and the scope set to the appropriate value for GCM (depending on your platform).
- The client app passes the registration token to the app server.
- The app server saves the registration token and acknowledges to the client app that the process completed successfully.
If the app server fails to complete its part of the registration handshake, the client app should retry sending registration token to the server or delete the registration token.
@alexislg2 what is the status on this? Have you resolved your issue?
Either way, it seems it is not a node-gcm
issue so I am going to close the issue on here :smile: let me know if this assumption is wrong
Hey, I'm using your package with the Cordova Push plugin https://github.com/phonegap/phonegap-plugin-push
It works great. But after few days/weeks, my users start not receiving notifications. And when I look at the logs I receive NotRegistered errors with theses users.
When app sends a new regId I save it in my database (overwriting the previous one) and do the same when I receive a canonical_id. What am I doing wrong?