onTokenRefresh没有在签名APK中调用,如果以前版本的应用程序安装没有实施FCM [英] onTokenRefresh not getting called in signed APK, if previous version of app installed doesn't have FCM implemented

查看:87
本文介绍了onTokenRefresh没有在签名APK中调用,如果以前版本的应用程序安装没有实施FCM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android应用程序的第6版中实现了FCM。 onTokenRefresh()会被调用,如果我的应用程序以前没有安装。但是当我以前的版本( 没有FCM实现 )的应用程序已经安装,我用版本6进行更新,那么 onTokenRefresh ()没有被调用。



我是否需要从Play Store中卸载以前的应用程序版本,然后安装新版本?

解决方案

我认为应该仍然是预期的行为。 onTokenRefresh()将被称为第一次应用程序已安装。并非每次更新。所以也许你可以像这个手动强制执行 onTokenRefresh()如果你想手工强制 onTokenRefresh() c>,您可以创建一个IntentService并删除该令牌实例。然后,当您调用getToken时, 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.

Do I need to uninstall the previous app version from Play Store and then install new version?

解决方案

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:

If you would like to manually force the onTokenRefresh(), you can create an IntentService and delete the token instance. Then, when you call getToken, the onTokenRefresh() method will be called again.

这篇关于onTokenRefresh没有在签名APK中调用,如果以前版本的应用程序安装没有实施FCM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆