Firebase FCM getToken() throws apns-token-not-set error #12815
Unanswered
stevenc1981
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This seems like a bug to me but wants some opinion from the experts.
On some iOS devices, user is getting this APNS token unavailable error when executing
FirebaseMessaging.instance.getToken()
:Based on what I can see in the flutterfire code: https://github.com/firebase/flutterfire/blob/master/packages/firebase_messaging/firebase_messaging_platform_interface/lib/src/method_channel/method_channel_messaging.dart
It is calling
_APNSTokenCheck()
which callsgetAPNSToken()
anyways. Sure, I can callgetAPNSToken()
beforegetToken()
but there isn't any difference. I'll get null returned anyways. And even if I do a null check withgetAPNSToken()
, Android devices will get null fromgetAPNSToken()
andgetToken()
will not get executed.I think
getToken()
should handle both iOS and Android scenarios gracefully instead of throwing errors.Beta Was this translation helpful? Give feedback.
All reactions