firebase_auth, always got verifyPhoneNumberError, Invalid token when using phone auth on ios 12.1.2
always got verifyPhoneNumberError, Invalid token when using phone auth on ios 12.1.2(16C104), but the same code works on 12.1(16B91) and Android
Steps to Reproduce
- Doing verifyPhoneNumber()
FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: widget.phoneNumber,
timeout: Duration(seconds: 60),
verificationCompleted: phoneVerificationCompleted,
verificationFailed: phoneVerificationFailed,
codeSent: phoneCodeSent,
codeAutoRetrievalTimeout: phoneCodeAutoRetrievalTimeout);
Logs
flutter: auth failed, verifyPhoneNumberError, Invalid token.
[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14.2 18C54, locale zh-Hant-TW)
• Flutter version 1.0.0 at /Users/paulhsu/flutter
• Framework revision 5391447fae (7 weeks ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at /Users/paulhsu/Library/Android/sdk
• Android NDK at /Users/paulhsu/Library/Android/sdk/ndk-bundle
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 2.0.0
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.3
• Dart plugin version 182.5124
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2017.1.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 23.2.1
• Dart plugin version 171.4424
[✓] VS Code (version 1.30.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.21.1
[✓] Connected device (2 available)
• PAUL 的 iPhone • 6c0b50169f3f2e205e46f929790d57f495e8929f • ios • iOS 12.1.2
• iPhone XR • 22FC19E8-9A1E-46B6-8285-F5EA34DEF730 • ios • iOS 12.1 (simulator)
@paulhsu
The issue at https://github.com/flutter/flutter/issues/26627 has been closed and moved here. Future collaboration on this issue will be done here.
Hi @paulhsu
Did the proposed solution worked for you?
If you are still experiencing this issue
with the latest version of Flutter and FlutterFire plugin
can you please provide your updated flutter doctor -v
and your and your flutter run --verbose/flutter build --verbose ?
Also, to better address the issue, would be helpful
if you could post a self contained app on github
or the steps to reproduce it.
Thank you
@kroikie @iapicca Thanks for your help. I think you can close it, I don't encounter the issue now.
Hi @paulhsu I'm glad that you solved the issue, thank you for letting me know
@kroikie how did you fix it?
Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please. All system setups can be slightly different so it's always better to open new issues and reference related issues.
@iapicca in my case, i forgot to upload APNs key to firebase. It's fixed for me right now.
@paulhsu @iapicca I am facing the same issue guys, did it solve by adding the .p12 cert? I've uploaded the .p8 cert along with the key id and team id (that's what firebase recommends) - any insights would be appreciated :D