dpa99c / cordova-plugin-firebasex

Cordova plugin for Google Firebase
MIT License
569 stars 461 forks source link

Receiving push on old token #227

Closed archigo closed 4 years ago

archigo commented 4 years ago

Bug report

Current behavior:

Receiving system push message when no push is expected.

I'm not sure if this is a firebase issue or an issue with this plugin.

Expected behavior:

Push should only be received if we have subscribed to push messages.

Steps to reproduce:

This is on android only.

If you install your app and activate push, then everything works as expected.

However, if you uninstall your app, and then install it again (getting a new token) and do not activate push, even calling unregister, the phone will still show system push messages (even with the app in foreground). I assume this is because the token from the previous installation is still active on Firebase and it is somehow not detected that no app with that token exists anymore.

install -> activate push -> uninstall -> install -> don't activate push -> still receive push (as if the app is in the background)

Screenshots

Environment information

Runtime issue

dpa99c commented 4 years ago

Token management is entirely part of the Firebase SDK - this plugin merely observes and reacts to token changes made by the SDK and therefore there's no way the plugin can influence the behaviour of the Firebase SDK in relation to its internal handling of tokens.

mctdev-marius commented 3 years ago

Hello, i have the same problem. From what i can see the correct Firebase method to call is "deleteToken" of com.google.firebase.messaging.FirebaseMessaging witch is not present in your service. Can you please add it and merge. I already tried it on a different bundle and it works and it worked

dpa99c commented 3 years ago

@mctdev-marius the plugin code has been updated to replace the deprecated Firebase IID methods with the replacement Firebase Messaging methods so will resolve this issue with newer versions of the Firebase SDK. This is currently on the dev branch but will be merged to master and released in a new major version of this plugin. Hopefully this will happen today, if not sometime this week.

mctdev-marius commented 3 years ago

Grate, thanks it works on android now but ios is having the same problem. From what i can see ios library needs update like this. Uses the old methods.