Apple Login/Email Login
Learn how EasyAppSwiftUI project integrates Apple Login/Email Login
Set up Apple Sign In (Recommended)
We recommend you use Apple Sign In. Compared to traditional registration and login processes, Apple Sign In provides a better overall user experience. of course, if you don't plan to use Apple Sign In, you can skip this step.
Configure Apple Sign In
First, make sure you have an available Apple Developer account. If you haven't registered yet, please refer to the official documentation to register.
After registration, log in to your developer account and go to the Identifiers page, click the + button
Step 1: Register Services ID

Select Services IDs and click the Continue button

Description can be named using your app name + Services ID.
Identifier is recommended to be named as bundleID.ServicesID. Where bundleID is your app's unique identifier.
Click the Continue button

You can find bundleID in your Xcode project here.

Click the Register button

After completion, return to the Identifiers page and click the Services IDs we just created

If you can't find the Services IDs we just created, filter as shown below

Enable Sign in with Apple function and click the Configure button

In the popup window, you need to configure the following options:
Please replace SUPABASE_PROJECT_ID with your Supabase project ID. You can find it here

In the documentation example, our SUPABASE_PROJECT_ID is mutkgdbrerijqhqccalu.
- In
Primary App ID, select your App'sBundle Identifierfrom the dropdown. - In the
Domains and Subdomainsfield, entersupabase.co,SUPABASE_PROJECT_ID.supabase.co - In the
Return URLsfield, enterhttps://SUPABASE_PROJECT_ID.supabase.co/auth/v1/callback - Click the
Nextbutton andDonebutton

Click the Continue button and click the Save button

Step 2: Create .p8 Authentication Key for Apple Sign In
Go to the Keys page and click the + button

- Enter your
Key Name, for easier identification later, we recommend naming it with your app name + Keys. - Select
Sign in with Applefunction and click theConfigurebutton. - After clicking the
Configurebutton, select yourApp IDfrom thePrimary App IDdropdown. - Click the
Savebutton

Then click the Continue button and click the Register button


Step 3: Integrate Apple Sign In with Supabase
Go to your Supabase project, click the sidebar Authentication, click Sign In/Providers, click the Apple button.

In the popup window, you need to configure the following information:
- Enable
Enable Sign in with Applefunction - In the
Client IDsfield, enter yourServices IDand your app's unique identifierbundleID. (separated by commas, no spaces)
The Secret Key (for OAuth) field can be left empty.
- Click save
Forgot Services ID and bundleID? No problem, let's review again.
-
On the
Identifierspage, find theServices IDswe just created.
-
In your Xcode project, find
Bundle Identifier.
Or on the Identifiers page, you can also find it

Step 4: Test Apple Sign In
Go back to the Supabase console and check the Users table, you can see the user information from your Apple Sign In.

Congratulations πππ, you have successfully integrated the Apple Sign In function.
Support Email Verification Function
Supabase enables email authentication by default, and EasyApp of course supports it. But you need to configure Deep Linking. The configuration process is very simple.
- Set
URL Typein Xcode

In the screenshot, you need to fill in identifier and URL Schemas
identifieris recommended to use Bundle Identifier.URL Schemasis recommended to use your App name.
- Configure
Deep Linkingin Supabase
Next, go to the Supabase Authentication page and click the URL Configuration button.

Click the Add URL button and enter your App's URL.
When filling in Deep Linking, we recommend using the format YourAppName://user?type=sign_up.
Let me explain why we set it up this way, where user represents the module name, type represents the type, and sign_up represents email verification.
The user module has the following types:
sign_up: email verificationreset_password: password reset
So we use type to distinguish.
In SwiftUI, we distinguish through module name + type.
.onOpenURL { url in
let value = url.getEaspAppDeepLinkUrlParam(hostKey: "user", name: "type")
guard value == "reset_password" else { return }
/// Handle password reset logic
}.onOpenURL { url in
let value = url.getEaspAppDeepLinkUrlParam(hostKey: "user", name: "type")
guard value == "sign_up" else { return }
/// Handle email verification logic
}Add URL filling rules: URL Schemas + ://
The EasyApp template has already configured the email verification/password reset Deep Linking rules. You need to configure identifier and URL Schemas in Xcode.
Then configure Deep Linking in your Supabase as shown in the figure.
If you have other needs later, just follow this rule to configure
At this point, you can normally use Email authentication function.
Process: User registration successful -> Supabase sends email -> User clicks link in email -> Directly returns to the App -> Login successful.
- Resend verification email
For user experience, we have made the following optimizations:
- After successful user registration, assuming the user does not verify the email in time, when they reopen the app at some point, we will check whether the current user has verified the email If the user has not verified the email, we will prompt the user to verify the email.
So we provide a VerifyEmailView
This component will automatically pop up when the user has not verified the email and supports users to resend verification emails.
The Supabase platform provides a default email sending service for you to try. This service is limited to 2 emails per hour and only provides best-effort availability. For production use, we recommend configuring a custom SMTP server. For specific operation guidelines, please refer to Custom SMTP Configuration Guide
Disable Email Verification Function
If you don't plan to use Email authentication function, you can disable them.

If you disable the email verification function, after user registration is completed, to optimize the shortest login process: we will let the user log in directly successfully.
Next, we will configure App In-App purchase
Last updated on