Home > other >  firebase_messaging/unknown: An unknown error has occured on Flutter IOS
firebase_messaging/unknown: An unknown error has occured on Flutter IOS

Time:10-29

Everything was working fine before but now firebase can't seem to create a new token. I'm trying to call await FirebaseMessaging.instance.getToken(); but getting this error


FLTFirebaseMessaging: An error occurred while calling method Messaging#getToken, errorOrNil => {
    NSLocalizedFailureReason = "Too many server requests.";
}
[VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: [firebase_messaging/unknown] An unknown error has occurred.
#0      MethodChannelFirebaseMessaging.getToken (package:firebase_messaging_platform_interface/src/method_channel/method_channel_messaging.dart:226:7)
<asynchronous suspension>
#1      _SignUpState._sendVerificationCode (package:shuri_parent/src/pages/sign_up.dart:343:25)
<asynchronous suspension>
#2      _SignUpState.build.<anonymous closure> (package:shuri_parent/src/pages/sign_up.dart:252:43)
<asynchronous suspension>

I'm using firebase_messaging: : ^10.0.9

My application is broken in production, I really need your help guys.

This is my flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 2.3.0-17.0.pre.121, on Mac OS X 10.15.7 19H1419
    darwin-x64, locale en-RW)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.61.0)
[✓] Connected device (2 available)

• No issues found!

Also my app is just recently deployed and doesn't have more than 10 users, other can't seem to use the app due to this blocker. Your help will be much appreciated.

CodePudding user response:

Make sure that your Flutter app targets iOS 8 or later. Please check this link below

https://firebase.google.com/docs/flutter/setup?platform=ios

in some android and ios devices not receiving firbase base responce because of its versions and api level

CodePudding user response:

Oh! my bad, I found the issue. My issue was a wrong api key of firebase in the GoogleServices-info.plist file

Thanks for all the support you gave me.

  • Related