简体   繁体   English

onTokenRefresh不会在签名的APK中调用,如果安装的先前版本的应用程序没有实现FCM

[英]onTokenRefresh not getting called in signed APK, if previous version of app installed doesn't have FCM implemented

I have implemented FCM in version 6 of my Android application. 我在Android应用程序的第6版中实现了FCM。 onTokenRefresh() is getting called if my app is not previously installed. 如果先前未安装我的应用,则会调用onTokenRefresh() 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. 但是,当我的应用程序具有以前的版本( 没有实施FCM )已经安装并且我用版本6更新它时,则不会调用onTokenRefresh()

Do I need to uninstall the previous app version from Play Store and then install new version? 我是否需要从Play商店卸载以前的应用版本,然后安装新版本?

I think that should still be the intended behavior. 我认为这应该仍然是预期的行为。 onTokenRefresh() will be called the first time the app is installed. onTokenRefresh()将在第一次安装应用程序调用。 Not every time it's updated. 不是每次都更新。 So maybe, you could manually force the onTokenRefresh() like what is mentioned in this post : 所以也许你可以手动强制onTokenRefresh()就像这篇文章中提到的那样:

If you would like to manually force the onTokenRefresh() , you can create an IntentService and delete the token instance. 如果要手动强制onTokenRefresh() ,可以创建IntentService并删除令牌实例。 Then, when you call getToken, the onTokenRefresh() method will be called again. 然后,当您调用onTokenRefresh()时,将再次调用onTokenRefresh()方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM