Closed tpucci closed 11 months ago
Hi @tpucci, the FirebaseMessaging.instance.deleteToken()
method does not delete the APNs token. It deletes the FCM token.
If you call FirebaseMessaging.instance.getToken()
and then call FirebaseMessaging.instance.deleteToken()
you do get a new token. I don't think you can delete the APNs token with the firebase methods.
Is there any reason you'd want to delete the APNS token from within the app rather than the FCM token?
Hi @danagbemava-nc ! Thanks for you answer !
I use a third-party (Sendbird) that rely on APNS token for iOS (and they do not integrate with FCM). On logout, I would like to invalidate APNS token π
I thought deleteToken
would delete the APNS token as well.
Feel free to close the issue if it is not relevant π
Hi @tpucci, unfortunately, there doesn't seem to be a way to invalidate the APNS token (not that I have found anyway). It appears to be unique for each device per app.
This appears to be out of scope for this repo so I'll be closing this.
Thank you
Bug report
FirebaseMessaging.instance.requestPermission( sound: true, badge: true, alert: true, provisional: false, )
FirebaseMessaging.instance.getAPNSToken()
FirebaseMessaging.instance.deleteToken()
Steps to reproduce
Steps to reproduce the behavior:
final a = await FirebaseMessaging.instance.getAPNSToken(); await FirebaseMessaging.instance.deleteToken(); final b = await FirebaseMessaging.instance.getAPNSToken(); assert(a != b)
Doctor summary (to see all details, run flutter doctor -v): [β] Flutter (Channel stable, 3.13.7, on macOS 13.6 22G120 darwin-arm64, locale en-FR) [β] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [β] Xcode - develop for iOS and macOS (Xcode 15.0.1) [β] Chrome - develop for the web [β] Android Studio (version 2022.3) [β] IntelliJ IDEA Ultimate Edition (version 2023.2.3) [β] IntelliJ IDEA Community Edition (version 2023.1.4) [β] VS Code (version 1.84.0) [β] Connected device (4 available) [β] Network resources
β’ No issues found!
Dart SDK 3.1.3 Flutter SDK 3.13.7 app 1.0.0+1
dependencies:
dev dependencies:
transitive dependencies: