如何使用 phonegap 推送插件监控 FCM 令牌刷新

How to monitor FCM token refresh with phonegap push plugin

如此处所述https://firebase.google.com/docs/cloud-messaging/js/first-message#monitor-token-refresh FCM 令牌在某些情况下可以刷新,但我在 phonegap 推送插件文档中没有看到任何处理它的内容。 有人知道这个插件是怎么解决的吗?

我从 phonegap github 得到的答案:https://github.com/phonegap/phonegap-plugin-push/issues/2415 其中指出:

The on('registration') event is fired if there is a token refresh. Each time you get a registration event you need to check to see if the value is different than the one you previously had. If so, send it to the server.