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 1: Remoo

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.


Solution 2: Saurabh Kumar

The issue is with iOS 14.0/15.0 simulator. Unfortunately, it hasn't been solved in iOS 15.0 either. The solution is to use iOS 13.0 for emulator.

  1. Download iOS 13.0 emulator. BY default you will only have latest one, for example iOS 15.0, Go to Xcode. Tope left, click on xcode, then preferences, then click on components. Download the iOS 13.0 emulator.
  2. Click onto runner home page, go to general(beside sign in and capabilities). Under deployment info, check 13.0 iOS version.
  3. Go to your pod file and paste/edit this snippet at the end
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
    end
  end
end

This will set up all your configs to the required iOS 13.0 version.

Other requirements

  • Make sure you have a developer apple account set up

If you followed everything till now, it should all run well.


Solution 3: Emmanuel Montoya

I just surpassed this issue by ussing iOS 13.0 for simulator. It seems there's an issue with higher versions when using the simulator but not with physical devices.

You can download and install simulators all the way back to iOS 13.0 (which is the minimum version for Apple Sign-In. In Xcode:

Xcode > Preferences. Select the "Components" tab. Mark the simulators you want. Press "Check and Install Now".