我在我的 Android 应用程序版本 6 中实现了 FCM.onTokenRefresh()
如果以前没有安装我的应用程序,则会被调用.但是,当我的应用程序具有以前的版本(没有实现 FCM)并且我用版本 6 更新它时,onTokenRefresh()
没有被调用.
I have implemented FCM in version 6 of my Android application. onTokenRefresh()
is getting called if my app is not previously installed. But when my app with a previous version (which did not have FCM implemeted) is already installed and I update it with version 6, then the onTokenRefresh()
is not getting called.
我需要从 Play 商店卸载之前的应用版本,然后再安装新版本吗?
Do I need to uninstall the previous app version from Play Store and then install new version?
我认为这仍然应该是预期的行为.onTokenRefresh()
将在 第一次 应用安装时调用.不是每次都更新.所以也许,您可以手动强制 onTokenRefresh()
就像这篇 post 中提到的那样:
I think that should still be the intended behavior. onTokenRefresh()
will be called the first time the app is installed. Not every time it's updated. So maybe, you could manually force the onTokenRefresh()
like what is mentioned in this post:
如果您想手动强制 onTokenRefresh()
,您可以创建一个 IntentService 并删除令牌实例.然后,当你调用getToken时,onTokenRefresh()
方法会再次被调用.
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.
这篇关于onTokenRefresh 不会在签名的 APK 中被调用,如果之前安装的应用版本没有实现 FCM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!