GCM registration expire time?

3,055 views
Skip to first unread message

JC

unread,
Sep 6, 2012, 1:24:34 PM9/6/12
to andro...@googlegroups.com
Hi ,
I know that there's life span time for server-registered and the default value is 7 days, should I re-do the whole GCM registration process after 7 days?
And, how long is the expiration time for GCM registration once I registered? 
Considering about the case if an user made GCM registered for an app, and then factory-reset the device, how could the app server side get aware of it?

Thanks.

Felipe Leme

unread,
Sep 6, 2012, 2:02:56 PM9/6/12
to andro...@googlegroups.com
Hi JC,

On Thu, Sep 6, 2012 at 10:24 AM, JC <jiaw...@gmail.com> wrote:
I know that there's life span time for server-registered and the default value is 7 days, should I re-do the whole GCM registration process after 7 days?

I'm assuming you're referring to the GCM library isRegisteredOnServer() method. That method in theory could always return the value it was set (by the app), but it has a timeout as a safeguard for the cases where the app sent the registration to the 3rd-party server, but the 3rd-party server lost it (for instance, due to a database corruption). So, when it returns false after 7 days, it doesn't mean that the registration is invalid on GCM, but that your app should send it to the 3rd-party server again. 
 
And, how long is the expiration time for GCM registration once I registered? 

There is no explicit expiration time, but as the doc states:

Note that Google may periodically refresh the registration ID, so you should design your Android application with the understanding that the com.google.android.c2dm.intent.REGISTRATIONintent may be called multiple times. Your Android application needs to be able to respond accordingly.

 
Considering about the case if an user made GCM registered for an app, and then factory-reset the device, how could the app server side get aware of it?

In this scenario, a factory reset would have the same effect as if the old device was turned off forever and the user bought a new device.


 
Reply all
Reply to author
Forward
0 new messages