0

After some fits and starts, I've gotten Android C2DM working in the emulator. The first time the app launches, it registers with the C2DM service, using code from the chrometophone project. The registrationId is saved in the preferences, and used on subsequent launches.

This seems to work just fine launch to launch, as long as the emulator keeps running. However, if I kill the emulator and restart it, then the app requires a new registration to start receiving C2DM messages again. Is this known/expected behavior?

shawkinaw
  • 3,190
  • 2
  • 27
  • 30

1 Answers1

0

Yes, this is known/expected behaviour. Item 2 in Enabling C2DM reads:

If the registration is successful, the C2DM server broadcasts a REGISTRATION Intent which gives the application a registration ID. The application should store this ID for later use. Note that Google may periodically refresh the registration ID, so you should design your application with the understanding that the REGISTRATION Intent may be called multiple times. Your application needs to be able to respond accordingly.

I found that the registration ID changes quite often. I also found that even after the registration ID changes, older ones may still work for some time.

Bert Regelink
  • 2,696
  • 23
  • 17