iOS

Sign In with Apple

9min

Sign In with Apple - Swift

Introduction

In this section you learn how to get started with Sign In with Apple using our Swift template and get ready to use Back4App in a few easy steps.

Prerequisites

To complete this quickstart, you need:

  • Xcode 11
  • Set up Sign In with Apple in your Apple Developer account.

1 - Get the template

Clone or download the template at Back4App’s GitHub repository, open the Swift foder.

2 - Open the project template

  1. Open Xcode.
  2. Click on File>Open.
  3. Navigate to the project folder and double click on app.xcworkspace.
  4. Wait for Xcode to open the project.

3 - Setup app’s credentials

Update your App Delegate’s Parse Client Configuration values to set up the app’s credentials. Parse iOS SDK uses these settings to connect to the Back4App servers.

  1. Open your App Delegate file: AppDelegate.swift
  2. Go to your App Dashboard at Back4App website.
  3. Navigate to app’s settings: Click on Features>Core Settingsblock>Server
  4. Return to your AppDelegate.swift file and paste your applicationId and clientKey.

See more at our New Parse App guide.

4 - Replace the Bundle Identifier

In your target, replace the Bundle Identifier by the one you created when setting up Sign In with Apple in your Apple Developer account

Document image


Also add the Sign In with Apple in the Capabilities of your App

Document image


5 - Test your App

  1. Build your app in a device or simulator (Command+R)
Document image


2. Wait until the Sign in with Apple screen appears.

3. Click the button and do the login process.

4. Find your app and click on Dashboard.

5. Click on Core.

6. Go to Browser.

If everything works properly, you should find a class named User as follows:

Document image


Next Steps

At this point, you have learned how to get started with iOS apps.

Learn more by walking around our iOS Tutorials or check Parse open source documentation for iOS SDK.