Sign In with Apple in iOS App

Updated 15 December 2023

Save
Sign In with Apple in iOS App

“Sign In with Apple” is a new authentication feature in iOS 13. Like login with Facebook and Gmail now, you can easily and securely log in with your Apple account also.

Please follow the below steps to integrate Sign In with Apple in your iOS application.

Note: To integrate Sign In with Apple you must have updated Xcode version 11.1

1- Setup Sign in with Apple in Project

Step 1: Create a new project, Go to “Target”, click on “Capability” and add “Sign In with Apple” capability in your project.

Setup Sign in with Apple in Project

Step 2: Now configure this Sign In with Apple capability in app identifier in Developer account.

Certificates, Identifiers & Profile Identifiers > Identifiers > Your app identifier

Configure Sign In with Apple capability in Developer account

Step 3: Then, add Keys for Apple Sign in. To do this Go to,

Certificates, Identifiers & Profile Identifiers > Keys > Create Keys

Add Keys for Apple Sign in

Step 4: Enter the name of keys and check Sign in with Apple option and click on configure button and choose your app bundle id, then click on Save and Register the Key.

2- Do the Code on project

Step 1: Add a Button on UIViewController in storyboard.

Step 2: Make the outlet of that btn and name it as appleSignInBtn, also make the action outlet of that button and name it as appleSignInBtnClicked.

Step 3: Let’s add below code in View Controller

Step 4: Now, make extension to implement ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding methods.

You can run the app now and check the feature.

A button will be shown and when you click on the button it will open the popup with AppleId information, you can login and continue.

Hope this article helps you.

For any queries, please feel free to add a comment in the comments section.

author
. . .

Leave a Comment

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


Be the first to comment.

Start a Project


    Message Sent!

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

    Back to Home