gpt4 book ai didi

android - 如何启动 android GCM token 刷新?

转载 作者:太空宇宙 更新时间:2023-11-03 13:18:28 24 4
gpt4 key购买 nike

根据 docs ,

To protect the client app and app server from potential malicious re-use of registration tokens, you should periodically initiate token refresh from the server. When GCM registration token refresh is initiated from server side, the client app must handle a tokenRefreshed message with the GCM registration client/server handshake.

启动 gcm 注册 token 刷新的步骤是否记录在某处?

我知道 InstanceIDListenerServiceonTokenRefresh。这些用于创建新 token 并将其更新到您的应用服务器。但具体如何做以下位呢?

periodically initiate token refresh from the server

最佳答案

执行此操作的最佳方法是在服务器上安排一个作业,每隔几个月(GCM 建议 6 个月)发送一次带有 ACTION REFRESH_TOKEN 的通知。在客户端应用程序的消息回调中,切换 ACTION 并处理刷新 token 。


旧答案

你看过这个页面吗: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.

关于android - 如何启动 android GCM token 刷新?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32167533/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com