Check Mobile App
Read now
Start a Project

Apple SignIn in Flutter

Save

Apple SignIn in Flutter helps to integrate Apple SignIn for iOS Users in the app. Social Login is very common nowadays. Everyone prefers to SignUp for the Applications with the help of a Social Login.

It reduces the amount of time a user spends filling out the details in order to Create an Account.

There are several types of Social Login supported by Flutter –

Steps for Integrating Apple SignIn in Flutter on Firebase Console

Firstly, we will need to enable “Apple Sign In” on Firebase Console.

Step-1 –> Go To “Firebase Console“. Select your Project.

Step-2 –> Click on “Authentication” from the Drawer Menu

Step-3 –> Now, click on “Sign-in method” Tab.

Step-4 –> Here, you will find all the types of authentication which Firebase supports.

We have to select “Apple” and enable it.

Steps to Enable Apple SignIn in Flutter through Apple Developer Account

Secondly, we will have to also configure “SignIn with Apple” from Apple Developer Account.

Step-1 –> Go to Apple Developer Account and select “Certificates, Identifiers and Profiles”.

Step-2 –> Now, go to Identifiers and select the Identifier linked with your app.

Step-3 –> Select “Sign In with Apple” within the identifier and “Save” it.

Step-4 –> Once you have enabled Sign In with Apple from Apple Developer Account, now you will have to add it in the Xcode Capability Section.

Once we are done with it, we are all set to write our code.

Step-1 –> Firstly, we will need to add the dependency in our pubspec.yaml file

After adding the dependency, run ‘pub get‘ command.

Step-2 –> Now, we will create an Apple Sign In Button which is provided by the dependency.

Here, we have “type” property which specifies what type of button you want signin,default or continue.

“onPressed” will be used to execute the function.

There are some other properties like cornerRadius, style etc.

Apple SignIn is not supported by all the devices so we also need to add a check in order to determine that the SignIn with Apple will work or not on a particular device.

Here, we have added a check for AppleSignIn supported devices and after that if AppleSignIn is supported by the device we have requested for the Email and FullName value.

We can also initialize the Scope Value as per the need with the help of Scope.rawValue(value)

After adding this, now we also have to handle the cases whether the user has logged in successfully or not or is there any exception.

For this we can define some cases, on the basis of the status of login result.

The output of the code is –

Conclusion

In this blog, we have discussed about Apple SignIn in Flutter.

I hope it will help you out in understanding and getting a brief idea about it.

Thank you for reading!!

References 

https://medium.com/smartters-studio/flutter-login-with-apple-3a98582f53a1

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


2 comments

  • seta
    this package is discontinued. can u please update this article
    regards
  • css.php

    When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

    Michael Urresta

    Michael Urresta

    Talk to Sales

    Global

    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home