我已经在我的 Android 应用程序版本 6 中实现了 FCM。如果之前未安装我的应用程序,将调用 onTokenRefresh()
。但是当我的应用程序已经安装了以前的版本(没有实现 FCM)并且我用版本 6 更新它时,onTokenRefresh()
没有被调用。
我是否需要从 Play 商店卸载以前的应用程序版本,然后再安装新版本?
最佳答案
我认为这仍然应该是预期的行为。 onTokenRefresh()
将在第一次安装应用程序时调用。不是每次都更新。所以也许,您可以手动强制执行 onTokenRefresh()
,就像此 post 中提到的那样:
If you would like to manually force the
onTokenRefresh()
, you can create an IntentService and delete the token instance. Then, when you call getToken, theonTokenRefresh()
method will be called again.
关于android - onTokenRefresh 未在已签名的 APK 中调用,如果安装的先前版本的应用程序未实现 FCM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39633285/