Search code examples
androidandroid-c2dmgoogle-cloud-messaging

Migrating to GCM but still have C2DM registration id


I am in the process of migrating my android app from C2DM to GCM. I have the server-side setup to receive both with an indication of the IDs that are GCM vs C2DM, and then on the server side I send out via the appropriate service depending on the service it is registered for.

The problem that I have run into is that the app is registering with my server as GCM (with the app update to use the new sender id in the intent.) However unfortunately the ID that it passes to the server for a registration id is actually the old C2DM ID.

Is there something I need to be doing as part of this migration (in the app code) to make sure I get a new (GCM) ID rather than continuing to use the existing C2DM registration id. This is easy for me to test and reproduce and I get consistent results every time (MisMatchedSenderId from GCM server). Do I need to first unregister the C2DM id?


Solution

  • We were able to figure out what the issue was, because the device had a registration id (c2dm) already, it didnt even bother trying to hit the registration server with the new senderId (for gcm) and thus it was using the old c2dm registration id. Thanks for the comments