capacitor-community / fcm

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

refreshToken() returns old registration token on Android #149

Closed kashz closed 4 months ago

kashz commented 11 months ago

Describe the bug

refreshToken() returns a registration token before refresh. This may be because getToken() was called without waiting for it to be deleted.

https://github.com/capacitor-community/fcm/blob/db4ac4631ef18d8e91299630a0e7c96c04ab7e98/android/src/main/java/com/getcapacitor/community/fcm/FCMPlugin.java#L86-L94

Expected behavior Always return new registration token.