Understanding getDeviceToken() method in PushNotification extension
Please, describe getDeviceToken() method.
Multiple call of register() is not recomended by Google.
So, Do your extension store DeviceToken between app launches?
And how do you solve problem with app apdated versions?
It is Google recomendation (http://developer.android.com/google/gcm/client.html):
"Check if app was updated; if so, it must clear the registration ID since the existing regID is not guaranteed to work with the new app version."
Thanks!
Hi,
getDeviceToken does not call register, the register function does this. The getDeviceToken simply returns the current registration id which is stored internally in the extension.
You should manage registration and unregistration in your application, using the register and unregister functions to retrieve and clear (respectively) the registration id.
Cheers
-
The registration ID is not stored across application updates or restarts so you shouldn't have to do anything in particular, just call register at some point in the start up of your application.
Cheers
-
Arctg commented
Do I have to detect new app versions and clear registration id? Or it is done automtically in your extension.