As per the the docs,
To protect the client app and app server from potential malicious re-use of registration tokens, you should periodically initiate t
The best way to do this would be to schedule a job on the server that sends a notification with ACTION
REFRESH_TOKEN
every few months (GCM recommends 6 months). On the client apps, on your message callback, switch
on the ACTION
and handle the refresh token.
Old answer
Have you seen this page: https://developers.google.com/instance-id/guides/android-implementation#refresh_tokens
The Instance ID service initiates callbacks periodically (for example, every 6 months), requesting that your app refreshes its tokens. It may also initiate callbacks when:
- There are security issues; for example, SSL or platform issues.
- Device information is no longer valid; for example, backup and restore.
- The Instance ID service is otherwise affected.