How to initiate an android GCM token refresh?

前端 未结 1 983
别那么骄傲
别那么骄傲 2021-01-21 00:30

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

相关标签:
1条回答
  • 2021-01-21 00:37

    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.
    0 讨论(0)
提交回复
热议问题