How to Integrate the New ‘Sign in with Apple’ Button in iOS App

iTechnolabs Inc
4 min readApr 17, 2023

--

The new Sign In with Apple was a hot topic during Apple’s 2019 Worldwide Developers Conference. Users can now use their Apple IDs and either Face ID or Touch ID biometric security to sign in to apps and websites that support Apple’s Sign In with Apple single sign-on (SSO) feature. This is just one of several new privacy-focused features in iOS 13.

Sign In with Apple has the potential to improve the user experience for app developers and publishers by reducing the hassle of account creation, sign-in, and onboarding. However, this could restrict companies’ ability to market to app users outside of the app itself, as publishers would not have access to users’ email addresses and names unless the company specifically requests it.

However, supporting this new feature is a no-brainer for any iOS app that requires account sign-in. This is especially true if your app already integrates with other SSO providers like Google or Facebook. If your app doesn’t support these other SSO options, you’ll need to integrate Sign In with Apple by the end of 2019. After the 2022 Worldwide Developers Conference (WWDC), Apple introduced a new sign-in with an Apple button that developers of iOS apps will need to support. Now the question is how to implement this. Here’s how to add the new ” Sign in with Apple ” button to your iOS app.

Also, read: What is iBeacon, and Why is it used in iOS Apps Development?

Here are some crucial steps to Integrate New ‘Sign in with Apple’ Button in iOS App

Step 1: Thing you need to do is create an Apple Developer Account.

Navigate to the Identifiers section of your Apple Developer Account, select your app’s identifier from the list on the left, and then click Save.

Select Sign In with Apple from the list of Capabilities, select Edit, choose to Enable as the primary App ID, and finally, select Save.

Confirm and save your changes.

Select the Keys tab on the left side and return here.

You can add a new key by clicking the plus sign next to the ‘Keys’ heading.

Select the box to enable Sign In with Apple after providing a name.

Select your primary App ID by clicking the Configure button and then click the Save button.

Just hit the Next button, then the Register button, and finally the Finish button. (There is no need to save the key to your computer, as we will not be implementing ‘Sign in with Apple’ on this site.)

(Optional) You’ll need to add their domain and email address to get in touch with your users.

As I mentioned at the outset, using Apple’s “Sign in with Apple” feature allows users to remain anonymous during the login process.

Setting up a domain and a contact email address in your Apple Developer Account will allow you to communicate with those customers.

Pick More on the left, then hit the Configure button.

Then, enter your domain name and email address on the following page and click the Register button for each.

Click the Download button and save the.txt file to your computer to confirm the domain.

Create a folder on your FTP server called. Well-known (yes, with the dot), and then upload the file.

Check if you get any text when you type in “https://PUT YOUR DOMAIN HERE.com/.well-known/apple-developer-domain-association.txt” to see if the domain association is being read.

Then, afterwards, return and click the Verify button. (It could be a while before Apple can “see” the file on your server.)

Step 2: Implement Apple’s “Sign in with Apple” feature.

To add a new capability, head into your project, select your project from the left sidebar, click Signing & Capabilities, and finally click + Capability.

To add your Apple ID, double-click the Sign in with Apple button in the new window (or search for it by typing “apple”).

Step 3: Include a “Sign in with Apple” button.

There are two options for displaying the “Sign in with Apple” option.

To avoid having your app rejected during the review, style your button by Apple’s Sign in with Apple — Human Interface Guidelines, or use the class ASAuthorizationAppleIDButton.

Adding an Apple ID Authorization button (ASAuthorizationAppleIDButton) is the first available choice.

Update your LoginViewController with the necessary instructions:

Choice 2: Inserting a User-Defined Button

If you’d prefer to use a different button than the ASAuthorizationAppleIDButton class does, insert the following code into your LoginViewController.

Read more about New ‘Sign in with Apple’ Button in iOS App

--

--

iTechnolabs Inc

Web Development | Mobile App | Software Development Company