0

Sometimes when i try to register for C2DM, I get SERVICE_NOT_AVAILABLE error. I used the code that has been given in googletochrome application when this error occurs. I just want to ask for how many times it retries andwhat is the possibility that it will register after retries. Is there a better alternative?

Bob
  • 22,810
  • 38
  • 143
  • 225
Rookie
  • 8,660
  • 17
  • 58
  • 91
  • You need to implement the retry logic yourself, e.g. you can retry in 10 seconds, and if fails again, retry again in 30 seconds, then 60, then 120, etc. – azgolfer Jun 19 '12 at 16:21
  • You could look at UrbanAirship as an alternative, its free to use with the c2dm wrapper but there is a fee to use their in house developed transport system called helium. – akshaydashrath Jun 19 '12 at 20:21

1 Answers1

0

It will not do any retries, this is left for the developer to implement. Google recommends using exponential backoff, the algorithm can be seen here: http://en.wikipedia.org/wiki/Exponential_backoff

I have found that the emulator gets a SERVICE_NOT_FOUND response when the intent is run on a new launch, all subsequent requests seem to work properly for me

Jake
  • 513
  • 5
  • 16