正如这里所说 https://firebase.google.com/docs/cloud-messaging/js/first-message#monitor-token-refresh FCM令牌可以在某些情况下刷新,但在PosiGAP推送插件文档中,我看不到任何处理它的方法。 有人知道这个插件是如何解决的吗?
我从phonegap github得到的答案是: https://github.com/phonegap/phonegap-plugin-push/issues/2415 其中规定:
如果存在令牌刷新,则会触发on('registration')事件。 每次你得到一个注册活动,你需要检查是否 值与以前的值不同。如果是,请发送给 服务器。