Appearance
Configuring your app client ID
To use Privy's Swift SDK, you must first create a client app id for your iOS app in the Privy Dashboard.
Follow the steps below to get started!
Register allowed application IDs
A Privy application can be configured to restrict which mobile apps can use its client-side App ID (similar to allowed domains for web apps). For this, we'll use the unique value that identifies your app in the Apple App Store.
Copy your project's bundle identifier, which you can find under the "Identity" section of your app's target file. It may have the format "com.myorg.app".
Navigate to the Privy Developer Dashboard, then Settings page > Clients tab.
Create a new client, add specify its name and environment type.
Edit the newly created client to add your bundle identifier. After successfully adding the identifier, it should look like:
INFO
Before integrating authentication, you must enable the particular login method in the Privy Developer Dashboard.
Configure allowed URL schemes
To use Privy's OAuth login flows (Apple, Google, etc.), you must also register your app's URL scheme (e.g. myapp
) with Privy.
First, register your URL scheme in your Xcode project. If you're unsure how, you can follow these steps.
Then, register it within the Settings page > Clients tab for your app in the Privy Dashboard. This configuration is right below the configuration for allowed application IDs, which you just completed.
Please note:
- Multiple URL schemes can be added for the same Privy App ID.
- An empty list will mean that requests coming from URL schemes other than web defaults (
http
andhttps
) will be rejected. You must register at least one URL scheme.
Why is this required?
Certain flows within the Privy authentication process require Privy to register allowed callback URLs with third-party service providers. The plainest example of this is social login flows using the OAuth 2.0 Protocol, where Privy must register allowed callback URLs with Google, Apple, and other OAuth login providers.
Configuring your allowed URL schemes in the Privy Dashboard ensures Privy updates the appropriate settings with these third-party service providers!