0

I have read several of the questions answered related to token expiration. The consensus seems to be 1) store your tokens locally (they usually don't change for some time after issued, but they might), and 2) update the server when you have a new token.

That said, are there cases where one might start their app and get new tokens (suppose they change and either GCM or APNS grants a new one to a device) but for some reason the device cannot access your server (due to network conditions, server down, etc.)? If so, then it would seem that you have a situation where a device is out there with a new token and you can no longer reach it.

I assume that, should this unfortunate series of events happen, the only thing that can be done is to make sure that the mobile app ensure that the server has received the updated token and - if not - retry when the app is re-launched later. However, if push notifications are key to prompt the user, then really the device is out of reach until they initiate a launch (it would seem).

Is that correct or are there other ways to deal with this corner case?

  • This [question](http://stackoverflow.com/questions/31061354/when-do-gcm-tokens-expire-and-what-is-the-instanceid) might be related to your inquiry. Basically it says that the app can call `getId()` when the InstanceID is now invalid. – adjuremods Jan 30 '16 at 09:43
  • Yes, I think you're right, although that falls under the category of "what can the app do?". I'm actually wondering if it's possible that the device ID changes (e.g., say the user has uninstalled and re-installed the app) and the ID never reaches the server. My guess is that the answer is (1) make sure your app is hardened to always insist on some sort of server ack to ensure that it has the latest and (2) if your app is not interesting enough that users use it regularly, you unfortunately suffer from this potential corner case where you miss a device ID update – CharlieBucket Jan 30 '16 at 23:29

0 Answers0