Flutter : Sign in With Apple

Introduction

Recently Apple launched its own Login method.Sign in with Apple is an alternative to the existing sign in with Google and Facebook options that apps and websites often offer. Apple’s version protects your privacy and even lets you mask your email address.

In this article, I will be showing how to set up and implement Apple Sign In with Flutter.

Note : It can only be implemented in ios and only in mac having xCode(Software to develop ios apps). For Android We can use Google Login.

Step 1

Add the dependency to your pubspec.yaml file . You can get the latest version from https://pub.dev/packages/apple_sign_in

You can install packages from the command line:

Alternatively, your editor might support flutter pub get like Android Studio and Visual Studio code .

Step 2

Configuration in Xcode

Open the Flutter project with Xcode by doing right click on the project then Flutter > Open ios module in Xcode .

|

|

|

|

|

In Xcode go to the project settings and click on Signing & Capabilities .

|

Click on the Capability and a dialog box will appear where we should search for Sign in with apple and click on the result.

|

|

|

|

Step 3

The real step ( coding )

  1. import the “apple_sign_in.dart” to use it’s functionality .

2. In initState( ) of Scaffold initialise the Functionality .

3. Place the Apple Sign in button Specially provided for this operation .

4. Define the appleLogIn( ) method for the sign in functionality

If Available then We can request for login

Handle the result according to your requirement

You can send the credentials to your backend on whatever you want to do.

Step 4

Running the app

Screenshots of the output

Conclusion

Now, our “Login with Apple Tutorial” is complete. I hope that you have received some useful information from this article.

You can follow me on Twitter and LinkedIn . Also, don’t forget to checkout our Website. Thank you for reading, if you enjoyed the article make sure to show me some love by hitting that clap (👏) button!

Happy coding…

Guru Prasad Mohapatra

Smartters’ Studio

A group of tech enthusiastic people spreading their…