capacitor-plugins
capacitor-plugins copied to clipboard
Delete the Push FCM Token to get a new one
Feature Request
Plugin
@capacitor/push-notifications
Description
It would be nice if there is a option to delete the current token and get a new one from FCM. Because we an delete the token from the user server side, but there are circumstances where this could fail and then a user gets notifications even when he is logged out. So the option to get a fresh fcm token would be nice.
+1
Good day, in the plugin https://www.npmjs.com/package/cordova-plugin-fcm-with-dependecy-updated Exists a function for regenerate a new token. Is it possible to do the same with this plugin?
@josuelmm Did you try the deleteInstanceId() function in the plugin you posted? Because we did and it doesn't seem to work. The token from this plugin is also always the same.
And the tokens from that plugin and from this plugin here are not the same!
The function "deleteInstanceId" does not exist inside the plugin's definitions.d.ts
I mean from the plugin you posted, there is a FCM.deleteInstanceId()
function. I think that is the function to regenerate the token you meant?
Yes but it is an old plugin.
I just made the modification in the source code and it works for me. I created a delete function and then run register again and it generated another token for me.
Awesome! Could you share your modifications? I'm totally lost. Thanks!
Check this => https://github.com/ionic-team/capacitor-plugins/pull/1110
Could this be merged to the original repo? I think this is a must have! :)
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.