Apple Sign In doesn't complete with Flutter

1,673

Solution 1

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

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.

Share:
1,673
Aymeric Le Feyer
Author by

Aymeric Le Feyer

Updated on January 01, 2023

Comments

  • Aymeric Le Feyer
    Aymeric Le Feyer over 1 year

    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!
    
    • Peter Koltai
      Peter Koltai over 2 years
      Have you tried it on real iOS device as well?
  • Aymeric Le Feyer
    Aymeric Le Feyer over 2 years
    Here was the problem, a usefull error message appears when I tried on real device.. Thank's