I am trying to add Sign in with Apple logging method but when I click on button nothing is happening.

I am using https://pub.dev/packages/sign_in_with_apple.

Here is my code:

SignInButton(
      Buttons.AppleDark,
      text: Sign in with Apple,
      shape: RoundedRectangleBorder(
         borderRadius: BorderRadius.circular(50)
      ),
      onPressed: () async {
         final credential = await SignInWithApple.getAppleIDCredential(
            scopes: [
               AppleIDAuthorizationScopes.email,
               AppleIDAuthorizationScopes.fullName,
            ]
         );
       },
),

when I tried launch this on Simulator dialog popped up to go to settings. Obviously I can't login on Simulator, so I decided to test it on real device, but as I said, when I click on this button nothing is happening.

EDIT: It turned out that I am getting error: SignInWithAppleNotSupportedException(Unsupported platform version: iOS 12.5.5)

There is something I can do about this? I don't have other real device to test it.


Solution 1: Suz Zan

The apple sign in is not supported for the iOS version below 13. So make sure to update the development target version in xcode.

You can also update the target version in podfile.lock From

# platform :ios, '9'

to

platform :ios, '13'

then run build ios command and should work fine.

Also, check if the signin with apple is available in the device before proceeding with login

onPressed: () async {
    final bool isAvailable = await SignInWithApple.isAvailable();
    if(isAvailable){
         final credential = await SignInWithApple.getAppleIDCredential(
            scopes: [
               AppleIDAuthorizationScopes.email,
               AppleIDAuthorizationScopes.fullName,
            ]
         );
      }
   },