Search code examples
iosflutterfirebase-authenticationapple-sign-in

Apple Sign In doesn't complete with Flutter


I'm developping an app using Flutter and Firebase Authentication.
I try to add the Apple Sign In in my Login page.
I'm following this tutorial https://dev.to/offlineprogrammer/flutter-firebase-authentication-apple-sign-in-1m64.
It works, Apple open the component in which I can log into enter image description here

But when I want to insert my Password, it loads infinitly. If I put a wrong password, it failed immediately

enter image description here

I havn't any log, my code is stuck at

final appleCredential = await siwa.SignInWithApple.getAppleIDCredential(
        scopes: [
          siwa.AppleIDAuthorizationScopes.email,
          siwa.AppleIDAuthorizationScopes.fullName,
        ],
        nonce: nonce,
      );

I tried on a iOS 15.0 simulator with flutter doctor as follow

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.4 20F71 darwin-arm, locale
    fr-FR)
[✓] 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.1)
[✓] Android Studio (version 4.1)
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
[✓] VS Code (version 1.54.1)
[✓] Connected device (2 available)

• No issues found!

Solution

  • its a late answer, but if you you still facing it or anyone comes in the future:
    Most likely you are using an iOS emulator which won't login, no matter how many times you tried to login and checked the password thousand time, I been there too... you need to use a real iOS.

    And another advice, if you tried to send notifications, it won't either work on emulator, which is very clear in the documentation, but still some people miss it.