【发布时间】:2015-08-18 16:21:18
【问题描述】:
随着对 Android GCM 的最后一次更改,现在提供了一个 InstanceIDListenerService,以便能够通过覆盖 onTokenRefresh 方法来监听令牌刷新。
但是什么时候会调用这个方法呢?有什么方法可以手动测试吗?
【问题讨论】:
-
没有简单的方法来手动测试它,但是从the Instance ID Lifecycle page,它指出
Tokens are unique and secure, but your app or the Instance ID service may need to refresh tokens in the event of a security issue or when a user uninstalls and reinstalls your app during device restoration。因此,您可能想在设备恢复期间尝试重新安装您的应用。
标签: google-cloud-messaging token