1

I'm working with GCM, and I managed to receive the registration token but when app data are deleted - that is one of the case in which the registration token is refreshed- I'm getting this error that is driving me mad:

04-10 23:51:39.819 23048-26249/com.adall.teambuilding D/RegIntentService: Failed to complete token refresh
                                                                      java.io.IOException: SERVICE_NOT_AVAILABLE
                                                                          at com.google.android.gms.iid.zzc.zzb(Unknown Source)
                                                                          at com.google.android.gms.iid.zzc.zza(Unknown Source)
                                                                          at com.google.android.gms.iid.InstanceID.zzc(Unknown Source)
                                                                          at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)
                                                                          at com.adall.teambuilding.gcm.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:52)
                                                                          at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                          at android.os.Looper.loop(Looper.java:145)
                                                                          at android.os.HandlerThread.run(HandlerThread.java:61)

As suggested on the website I'm doing exponential attempts to retry but it's not working
What should I do to fix the problem ?
Thx anticipately

Andrea Tulimiero
  • 17,693
  • 5
  • 21
  • 28

1 Answers1

0

A similar issue was raised were they resolved the issue by using Thread.sleep. Another answer suggests using getApplicationContext() when getting an instance of GoogleCloudMessaging (GoogleCloudMessaging.getInstance(getApplicationContext()))

Community
  • 1
  • 1
Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30