Search code examples
androidandroid-c2dmservice-not-available

SERVICE_NOT_AVAILABLE in C2DM


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?


Solution

  • 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