Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Canonical Registration ID and message ID format

  1. I have a problem with understanding Canonical Registration Id and getting it returned by Google. I have deliberately registered my Android app twice (to test Canonical Registration Id) but when I try to push a message to both Registration Ids I don't get in the return from Google a Canonical Registration Id.

  2. In addition, I would like to know what the format of the message Id returned by Google means. I can see in the log that it seems to consist of three parts <something>:<something2>%<something3>. Any idea what they mean? Does the 3rd part identify the device?

    [INFO com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220154718%921c249a6e2555b5 ] [INFO com.bipper.filters.PushUpdatesFilter] [ messageId=0:1349819220242456%921c249a6e2555b5 ]

like image 397
Thomas Vervik Avatar asked Oct 09 '12 21:10

Thomas Vervik


1 Answers

I managed to get a canonical registration id from GCM this way :

  1. The initial state : Application is installed on Android device and is registered to GCM. Sender server has the registration Id and manages to send messages to that device.

  2. Uninstall the application.

  3. Send two messages to the original (old) registration Id. The first will seem to work (server will receive a successful reply from GCM server). The second attempt will result in a "NotRegistered" error.

  4. Re-install the application and register to GCM. The device will get a new registration Id.

  5. Send a message using the old registration Id. The application will receive the message, but the server will get in the reply the new registration Id as canonical registration Id.

like image 82
Eran Avatar answered Nov 09 '22 22:11

Eran