For the complete documentation index, see llms.txt. This page is also available as Markdown.

🍏Sign In with Apple

Allow users to sign in to your app using their Apple ID - no password required.

What is Sign In with Apple?

Sign In with Apple lets your users authenticate using their Apple ID with a single tap, using Face ID or Touch ID to confirm. It's a fast, privacy-friendly login option that doesn't require users to create a new account or remember a password. Because Apple can hide users' real email addresses behind a private relay, users often trust it more than other login options.

Sign In with Apple feature uses a native iOS component - no Social Auth or Deep Links required.

However, if your app uses the Social Auth feature to offer any other third-party login (Google, Facebook, etc.), Apple requires you to also include Sign In with Apple, and those OAuth providers will require Social Auth and Deep Links.

Prerequisites

App Capabilities Configuration

App capabilities define what system-level features your app is allowed to use on iOS. Before Natively can include the Sign In with Apple feature in your build, the Sign In with Apple capability must be explicitly enabled in your Apple Developer account for your app's Bundle ID.

Natively Dashboard Setup

Before proceeding, make sure you have completed the App Capabilities Configuration step above.

  • Open your Natively app dashboard and navigate to Features > Social Auth > Sign In with Apple (iOS only).

  • Toggle the feature to Enabled.

  • Click Save.

  • Rebuild your iOS app.

Implementation

Choose your integration method below: Bubble.io Plugin (No-Code), JavaScript SDK (Code), or AI Agents (for AI-powered editors like Lovable, Base44, and Replit).

Initialization

Check Plugin

Before starting, verify if the Natively plugin is already installed in your Bubble project.

  1. Open your Bubble editor and navigate to the Plugins tab in the left sidebar.

  2. Check Installed Plugins: Look through your list of installed plugins for "Natively iOS & Android app builder".

    • If it IS installed: Check the version number. If an update is available (e.g., you see a button saying "Update"), click it to ensure you have the latest features and bug fixes.

  • If it is NOT installed: Click the + Add plugins button, search for "Natively", and click Install.

Setup logic

Natively - Apple Sign In

Events:

  • Apple Sign In Success

  • Apple Sign In Failed

States:

  • Email

  • Given Name

  • Family Name

  • Error

  • Subject - unique identifier based on your app + user iCloud (it's unique)

  • Initial Sign In - means that the user signs in/signs up for the first time to your app

Actions:

  • Sign In with Apple

How to use Sign In with Apple in Bubble

  • Add Natively - Apple Sign In element on the page.

  • Create a "Sign In with Apple" button (you can use a simple image or HTML/CSS). Find some examples here.

  • Add "Apple Sign In Success" event and the following actions

How to use

User identification

Always use subject as your primary user identifier - it's unique per user per app and never changes, even if the user switches devices or hides their email.

Email availability

Apple lets users hide their real email behind a private relay address. This relay address is only returned on the first sign-in; on all subsequent logins email will be empty if the user chose to hide it. Design your sign-up flow to handle this: capture the email on first login and store it; never rely on it being present on repeat logins.

Name availability

Same as email - givenname and familyname are only returned on the first sign-in. Store them immediately after the first successful login. On subsequent logins, these fields will be empty.

Show the Sign In with Apple button only on iOS

Since Sign In with Apple only works on iOS, make sure the button is only visible to iOS users. Use the Browser Info feature to detect whether the app is running on iOS, Android, or a web browser, and conditionally show or hide the button accordingly.

First-time vs returning users

Use resp.initial to distinguish between a new sign-up and a returning login. Run your account creation logic only when initial is true.

Resetting Sign In with Apple for testing

To simulate a first-time sign-in during development, go to iOS Settings > [Your Name] > Password & Security > Apps Using Your Apple ID, find your app, and tap Stop Using Apple ID. Your next sign-in will return all fields as if it's a fresh account.

Troubleshooting

The Sign-In button is not working or doing nothing

Likely causes: feature not enabled in Natively Dashboard, app not rebuilt after enabling, or the Natively Sign In with Apple JS SDK is not being used for this type of login.

Email is empty on login

Expected behavior if the user chooses to hide their email - not a bug. Should be handled in the sign-up flow.

Name fields are empty on login

Expected behavior on all logins after the first. Should be stored on first sign-in.

Sign-in succeeds, but the user is treated as new every time

Likely caused by using email as the primary identifier instead of subject.

User cancelled error

When the user dismisses the Apple Sign In prompt, resp.status returns false. Should be handled gracefully without showing an error to the user.

Testing reset not working

If "Stop Using Apple ID" doesn't appear for the app, the app may not have completed a successful sign-in yet.

Last updated