cordova-plugin-firebase icon indicating copy to clipboard operation
cordova-plugin-firebase copied to clipboard

onTokenRefresh is called is the app is closed?

Open sagits opened this issue 6 years ago • 4 comments

Hi, i want to know if the onTokenRefresh() method can be called while the app is closed.

I mean, native sendToken() sends a javascript command to the cordova webview when the native onTokenRefresh() is called, but if the app is closed theres no cordova webview to receive the command. In this case javascript onTokenRefresh() will only be called when the user opens the app?

This means that we can have users not receiving notifications because their token changed and was not sync with the API right?

Thanks in advance.

sagits avatar Feb 15 '19 13:02 sagits

+1

vitorplopes avatar Feb 19 '19 19:02 vitorplopes

+1 Did you find a solution?

dalavric avatar Apr 25 '19 07:04 dalavric

Hey guys, is there any update on this topic ?

This plugin is really awesome, works really good and would be amazing to have this problem solved.

Thanks

re2005 avatar Apr 11 '20 10:04 re2005

I haven't found a solution, but I discovered that firebase keeps the old token pointing to the new one for 24h (if you send a message to an old token that has been updated less than 24h ago, the device will receive it). You can find this information in their documentation.

sagits avatar Apr 13 '20 16:04 sagits