I have a problem with understanding
Canonical Registration Id
and getting it returned by Google. I have deliberately registered my Android app twice (to testCanonical Registration Id
) but when I try to push a message to bothRegistration Ids
I don't get in the return from Google aCanonical Registration Id
.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 ]
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I managed to get a canonical registration id from GCM this way :
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.
Uninstall the application.
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.
Re-install the application and register to GCM. The device will get a new registration Id.
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.