flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

firebase_auth, always got verifyPhoneNumberError, Invalid token when using phone auth on ios 12.1.2

Open kroikie opened this issue 7 years ago • 8 comments

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

  1. 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)

kroikie avatar Oct 13 '19 18:10 kroikie

@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.

kroikie avatar Oct 13 '19 18:10 kroikie

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

iapicca avatar Oct 22 '19 13:10 iapicca

@kroikie @iapicca Thanks for your help. I think you can close it, I don't encounter the issue now.

paulhsu avatar Oct 23 '19 00:10 paulhsu

Hi @paulhsu I'm glad that you solved the issue, thank you for letting me know

iapicca avatar Nov 20 '19 14:11 iapicca

@kroikie how did you fix it?

joaovirgili avatar Mar 04 '20 13:03 joaovirgili

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 avatar Mar 06 '20 11:03 iapicca

@iapicca in my case, i forgot to upload APNs key to firebase. It's fixed for me right now.

joaovirgili avatar Mar 06 '20 12:03 joaovirgili

@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

aizazzaheer avatar Apr 21 '20 23:04 aizazzaheer