Validate GCM registration ID (does it expires ?)

1,615 views
Skip to first unread message

Olexandr Tereshchuk

unread,
Apr 22, 2015, 7:57:10 AM4/22/15
to andro...@googlegroups.com
Rarely, but on Android 4.4.x and Google Play Services 6.x - 7.x, the registration ID, obtained via gcm.register(SENDER_ID) is not working - trying to send message to that device returns error NOT_REGISTERED.
Multiple calls to gcm.register(SENDER_ID) return same registration ID.

I guess that, it may be fixed by unregistering and then registering again. But can I determine on client side that registration ID is not valid and I have to do registration again ?

P.S. Pings to GCM server goes about every 5 minutes and server always returns ACK.

Diego Giorgini

unread,
Apr 22, 2015, 11:07:01 AM4/22/15
to andro...@googlegroups.com
Hi Olexandr,

if you obtain a registration-id on the device, then that registration-id is supposed to work (until you or the system unregister it, see my email in the other thread).

If you have any case where a newly created registration-id is not working, please send it to us so we can check it.

Thanks


--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/6ab66006-373c-40d1-9824-3d0c4f2ee586%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Olexandr Tereshchuk

unread,
Apr 23, 2015, 10:57:36 AM4/23/15
to andro...@googlegroups.com
Here is an example of such expiration - reg_id=APA91bHhUrwI5C41TZAmBxDrL5Nggtkoeu6uUKN38Z3lcasOgHbvQr8XHOrlJGotspWNQjCXwwHRKyMQsda2AC6AbRZin_kaZMvakOkph3ybojaejpisbQd3N3DBwd2994uJKZRWYqHD

It worked for about an hour or less, and then NotRegistered error pops up. Application was not changed/updated - I've just pushed different messages to device.
I've tried to re-register and obtain new token (by updating version code), but Play Services returned same reg_id and trying to send a message results in NotRegistered error.

середа, 22 квітня 2015 р. 18:07:01 UTC+3 користувач Diego Giorgini написав:

Olexandr Tereshchuk

unread,
Apr 24, 2015, 7:03:27 AM4/24/15
to andro...@googlegroups.com
And another example - having reg_id=APA91bFHadOaEzTo4qFZVAMZwMgeyFEt6gxPAYcN5a326K2iSZHBU3XR4prZv6aYBcaIPTwd6vttthLfEOFZC8Fdfj9Nz4OtY5uNYkRgoCzWBQNDypxHFdXm4c-1fUx-WvyO5DdYqZ0Z
Unregister/register - get same reg_id.
Trying to send GCM message via https://android.googleapis.com/gcm/send - NotRegistered error.
Trying to send Upstream message via gcm.send(...) - got 'message_sent' push from GCM server (but sending notifications to the device, still does not work):
    message_type: send_event
    event: sent
    google.message_id: APA91bFHadOaEzTo4qFZVAMZwMgeyFEt6gxPAYcN5a326K2iSZHBU3XR4prZv6aYBcaIPTwd6vttthLfEOFZC8Fdfj9Nz4OtY5uNYkRgoCzWBQNDypxHFdXm4c-1fUx-WvyO5DdYqZ0Z
    gcm.wakelock_id: 3

четвер, 23 квітня 2015 р. 17:57:36 UTC+3 користувач Olexandr Tereshchuk написав:

Olexandr Tereshchuk

unread,
Apr 28, 2015, 1:57:23 PM4/28/15
to andro...@googlegroups.com
Any update on this issue ?

I've posted a bunch on reg_id that become NotRegistered with no reason. I just trying to understand does it connected to some misusing of GCM service or bug on GCM server or whatever else....

середа, 22 квітня 2015 р. 18:07:01 UTC+3 користувач Diego Giorgini написав:
Hi Olexandr,

Diego Giorgini

unread,
May 5, 2015, 9:48:27 AM5/5/15
to andro...@googlegroups.com
Hi Olexandr,

thanks for your bug report and sorry for late reply.
Your feedback helped us to identify a scenario in which the generated registration-id was not actually working (leading to the behavior you described in your email).
The problem has been fixed and all the newly generated registration-id should work as expected. (please note that the registration id returned might be the same as before, but this time it would actually be valid).

For the mailing-list readers:
This problem was triggered under a specific configuration (the application being installed in multiple android profile on the same device) and a specific combination of events.
Only a very limited number of registration-ids have been affected by this problem, and calling gcm.register() again would restore the validity of the broken registration-id.

Cheers,
- Diego





Roman Mazur

unread,
Aug 1, 2015, 4:30:39 PM8/1/15
to android-gcm
I'm trying to a message using a couple of registration IDs. https://android.googleapis.com/gcm/send responds with success flags. But devices do not receive the message.
I'm writing to this thread because these IDs are also obtained on non-primary user.

Registration IDs:
APA91bGloYrom1fdwRBOtJ3eHuwLtaPIUEdgnWA0WBTKOpACJnxIdolFDKB_rcclHXD_L7IbK-nr3v7sdRAIFrnROFDo6iXmop_kCJKlcVOoqqGRmmUNfNpwdkSrWS3zq2xEevva9hR0
APA91bGa937tXvU74EeeIQo2gESEvBEA3vc4ZF2PWCyjabNXCDl51-55lOcCMazRoRmRAAKMHzczPKk--7bjgeFIzvgKIfWSVoV3OQ2K2GbNB-l_aLobPHbeP010IkfdLW9bOxRpDChI

Could somebody help me to track what is wrong with these IDs?

Roman Mazur

unread,
Aug 2, 2015, 7:49:15 AM8/2/15
to android-gcm
Here are message IDs that I do not see delivered:

0:1438460159005115%686a0ea2f9fd7ecd

0:1438460992754456%686a0ea2f9fd7ecd

Reply all
Reply to author
Forward
0 new messages