7

I read in the explanation in Android Cloud to Device Messaging Framework. After our app register successfully to C2DM server, we receive a registration ID. The registration ID lasts until the application explicitly unregisters itself, or until Google refreshes the registration ID for your application. When is exactly Google refreshes the registration ID for your application?? How do we know it so we can register again and send our new registration ID to our server.

Thank you.

user430926
  • 4,017
  • 13
  • 53
  • 77
  • 3
    That information is kind of slim right now, they suggest doing periodical refreshes of the ID, I think that means "were are still in beta and dont want to give any specifics so we can change it", but since this is only speculation, i´ll leave it as a comment and not an answer. – blindstuff Nov 24 '10 at 13:40
  • can you suggest how often should i refresh the ID?? Thanks. – user430926 Nov 25 '10 at 01:49
  • Right now im refreshing every time the main activity of my app is created, I have no idea how this will work, as this app isnt ready for deployment and hasnt been tested enough. I think you are going to have to test it out yourself and report back, it would be great help to yourself and everyone. – blindstuff Nov 25 '10 at 02:03

1 Answers1

10

According to discussions on the android-c2dm mailing list, refreshing the registration ID is not a frequent event, but your application should be able to handle it. The OS will fire the registration Intent again with the new registration ID.

See the following threads on Google Groups: [1] [2] [3]

gnuf
  • 2,722
  • 1
  • 25
  • 32
  • So in theory, it should go through our exact code path as the first time registration and "just work", correct? – Adam Jan 24 '12 at 17:09
  • Yes, as long as you aren't assuming that that code will only be called once. – gnuf Jan 27 '12 at 14:54