google cloud messaging - Confusion with Gcm Token using InstanceId -


i fetching id , token using instanceid , store somewhere in app. after reinstalling app, got new token , id. when i'm using old token , id sending message through gcm, shows success. if use token sending message, shows canonical. can explain in details?

example -> result :

1) "oldid:oldtoken" -> success

2) "oldtoken" -> success , canonical new token

3) "newid:newtoken" -> success

4) "newtoken" -> success

i have issue in 1st example: why not showing canonical , new token?

check link: click here

be noted canonical id returned in response when send message server google's gcm server. canonical registration id registration token of last registration requested client app . id server should use when sending messages device.

from thread:

when receive canonical registration id in response google, message accepted gcm server , gcm server attempt deliver device. whether sent device depends on whether device available (i.e. connected internet). if server sends gcm message both old id , new id, device 2 messages.

a canonical registration id defined id of last registration requested application. id server should use when sending messages device. if later on try send message using different registration id, gcm process request usual, include canonical registration id in registration_id field of response. make sure replace registration id stored in server canonical id.

old registration ids can remain active while. google tells you need update regid particular device/app combination means of canonical id in response sent message.

check related question:


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -