0

I am using PushPlugin with phonegap for android. Mobile is able to register properly with GCM but every time when I am starting the app, the java code written for device registration with GCM is executing. Seems mobile registration is happening again and again. Is there a need to call that java GCM code every time ? Or is it right to get id for the first time, store into the database and the next time ignore the GCM registration process?

Ajoy
  • 1,838
  • 3
  • 30
  • 57
  • The application token can change unexpectedly, so you will want to check the value each time the application runs. Obviously, you don't have to send the device token to your server each time--only for the device registration or there is a token change. – kindasimple Apr 16 '15 at 05:59

1 Answers1

0

To see how the plugin registers your device, read this related answer. When you get a registration ID, save it to your server if it is different, otherwise ignore it, as @kindasimple commented.

Some cases when registration ID may change:

  • Application is updated
  • Device OS is updated or upgraded
  • Some GCM issue

Read more

Community
  • 1
  • 1
Ajoy
  • 1,838
  • 3
  • 30
  • 57
  • Thanks @Ajoy ..How often the device id will change? – user2428218 Apr 17 '15 at 06:34
  • @user2428218 Registration ID might [change](http://developer.android.com/google/gcm/gcm.html#reg-state) if your app is updated, or the OS is upgraded, or any other issue on GCM – Ajoy Apr 17 '15 at 08:34