capacitor-community / fcm

Enable Firebase Cloud Messaging for Capacitor apps
https://capacitor.ionicframework.com/docs/
MIT License
237 stars 83 forks source link

add deleteToken #107

Open nvthuong1996 opened 2 years ago

nvthuong1996 commented 2 years ago

add deleteToken method call when user logout

iantearle commented 2 years ago

I think you could handle your logout yourself and add:

// Remove FCM instance
FCM.deleteInstance()
  .then(() => alert(`Token deleted`))
  .catch((err) => console.log(err));

To delete the token.

gladwelln1 commented 1 year ago

I've tried that and it doesn't seem to work.

Even after executing await FCM.deleteInstance() you still get the same token when executing await PushNotifications.register().