-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
resolution: fixedA fix has been merged or is pending merge from a PR.A fix has been merged or is pending merge from a PR.
Description
Bug report
Describe the bug
Prior to installations, deleteToken on iOS is used to refresh the token. Since the update, no longer invalidates the token.
Also please see the related issue for RNFB invertase/react-native-firebase#5570
I believe you have to delete the installations id first which then makes subsequent calls of deleteToken generate a new one
Steps to reproduce the behavior:
- call
await FirebaseMessaging.instance.deleteToken(); - call
await FirebaseMessaging.instance.getToken(); - See that the token has not changed
Expected behavior
A new FCM token should be generated, and the old one should be invalidated
Sample project
The current messaging example app on master branch, with the following button added:
ElevatedButton(
onPressed: () async {
print('Example: Getting FCM before');
String before = await FirebaseMessaging.instance.getToken();
await FirebaseMessaging.instance.deleteToken();
String after = await FirebaseMessaging.instance.getToken();
print('CHANGED token?? : ${before != after}');
},
child: const Text('Delete token')),
Additional context
Add any other context about the problem here.
Flutter doctor
Run flutter doctor and paste the output below:
Click To Expand
PASTE OUTPUT INSIDE HERE
Flutter dependencies
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
PASTE OUTPUT INSIDE HERE
Metadata
Metadata
Assignees
Labels
resolution: fixedA fix has been merged or is pending merge from a PR.A fix has been merged or is pending merge from a PR.