I am developing a phonegap app and followed this tutorial to implement PushPlugin. However, it says to register the app every time deviceready event is triggered. This means that it'll register the device on GCM even if it'd been previously registered.
This made me a little bit uncomfortable as it doesn't seem to be a good practice, since the device was already registered, so, I decided to come here to ask. Is this a good practice? If not, why? Do this have some long term complication?
A Registration ID is an identifier assigned by GCM to a single instance of a single application installed on an Android device. The device is assigned this identifier when it registers to Google Cloud Messaging.
Google Cloud Messaging (GCM) is a service that allows you to send push notifications from your server to your users' Android devices, and also to receive messages from devices on the same connection.
Open your app's settings and select Intercom for Android. Then find the "Enable GCM" section.
In our application we have found this to be a good practice for several reasons:
The API for registering the device returns a token that represents that device. From what I could see, GCM does not guarantee that the token will remain valid indefinitely. Thus failure to register could lead to expiration of your device token.
Registering with GCM, makes the service aware that your device is active. From what we observed, devices recently registered with GCM seemed to receive push notifications fastest. That is, given 2 devices, one recently registered (Device A), and the other that had last registered several days ago (Device B), Device A would always receive push notifications faster - often minutes before Device B. This is simply what we observed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With