---
title: Step 4. Customizing the user experience
description: PingOne iOS
component: orchsdks
page_id: orchsdks:davinci:use-cases/external-idp/ios/04_customize_the_user_experience
canonical_url: https://developer.pingidentity.com/orchsdks/davinci/use-cases/external-idp/ios/04_customize_the_user_experience.html
revdate: Tue, 25 Mar 2025 11:00:37 +0100
keywords: ["DaVinci", "Flows", "Tutorial", "Source Code", "Integration", "SDK", "iOS"]
section_ids:
  ios-apple-sdk: Implementing the Sign-in with Apple native SDK
  apple-ios-dependencies: Step 1. Add Sign-in with Apple SDK for iOS dependencies
  apple-ios-capabilities: Step 2. Add the Sign-in with Apple capability to your client app
  ios-facebook-sdk: Implementing the Facebook native sign-in SDK
  facebook-ios-dependencies: Step 1. Add Facebook SDK for iOS dependencies
  ios-facebook-client-properties: Step 2. Connect your client iOS app to your Facebook App ID
  ios-facebook-bundle-id: Step 3. Update your Facebook App ID to allow your client app to connect
  ios-facebook-url-types: Step 4. Associate Facebook redirect URIs with your client app
  ios-facebook-url-handler: Step 5. Add URL handling code to your client app
  ios-google-sdk: Implementing the Sign in with Google native SDK
  google-ios-dependencies: Step 1. Add Google SDK for iOS dependencies
  google-ios-specific-client: Step 2. Create an iOS-specific client profile in Google
  google-ios-specific-client-connection: Step 3. Connect your client iOS app to your Google client profiles
  ios-google-url-types: Step 4. Associate Google redirect URIs with your client app
  ios-google-url-handler: Step 5. Add URL handling code to your client app
---

# Step 4. Customizing the user experience

[icon: circle-check, set=far]PingOne [icon: apple, set=fab]iOS

You can use an IdP's native SDK libraries to handle social sign-on directly rather than redirecting the user in a web browser.

This can provide a smoother, more integrated experience for your users than the redirect method.

To support a native experience you add the native libraries as dependencies in your iOS application. If an IdP's native SDK libraries are not included in your app then the **External IdP** module falls back to use a browser redirect for social sign-on.

The Orchestration SDK for iOS supports implementing the following native libraries:

[icon: apple, set=fab, size=3x]

#### [Apple](#ios-apple-sdk)

Implementing the Apple native libraries for iOS

[icon: facebook, set=fab, size=3x]

#### [Facebook](#ios-facebook-sdk)

Implementing the Facebook native libraries for iOS

[icon: google, set=fab, size=3x]

#### [Google](#ios-google-sdk)

Implementing the Google native libraries for iOS

## Implementing the Sign-in with Apple native SDK

To use Apple's native SDK in your iOS app, you must complete the following tasks:

* [Step 1. Add Sign-in with Apple SDK for iOS dependencies](#apple-ios-dependencies)

* [Step 2. Add the Sign-in with Apple capability to your client app](#apple-ios-capabilities)

### Step 1. Add Sign-in with Apple SDK for iOS dependencies

To use Apple's native SDK in your iOS app you must add the `PingExternalIdPApple` module to your client application. When added the Orchestration SDK for iOS knows to use native libraries for Apple, rather than using a redirect.

To add the `PingExternalIdPApple` module to your client application:

1. In Xcode, select your project, and navigate to **Targets** > **General** > **Frameworks, Libraries, and Embedded Content**.

2. Click **[icon: plus, set=fa]Add items**.

3. Select `PingExternalIdPApple.framework` and then click **Add**.

   The result resembles the following:

   ![Adding native IdP dependencies to an iOS project.](../../../_images/xcode-native-idp-framweorks.png)Figure 1. Adding native IdP dependencies to an iOS project

### Step 2. Add the Sign-in with Apple capability to your client app

To add the **Sign-in with Apple** capability to your client application:

1. In Xcode, select your project, and navigate to **Targets** > **Signing & Capabilities**.

2. Click **[icon: plus, set=fa]Capability**, and then double click **Sign in with Apple**.

   The result resembles the following:

   ![Adding capabilities to an iOS project.](../../../_images/xcode-sign-in-with-apple-capability.png)Figure 2. Adding capabilities to an iOS project

## Implementing the Facebook native sign-in SDK

To use Facebook's native SDK in your iOS app, you must complete the following tasks:

* [Step 1. Add Facebook SDK for iOS dependencies](#facebook-ios-dependencies)

* [Step 2. Connect your client iOS app to your Facebook App ID](#ios-facebook-client-properties)

* [Step 3. Update your Facebook App ID to allow your client app to connect](#ios-facebook-bundle-id)

* [Step 4. Associate Facebook redirect URIs with your client app](#ios-facebook-url-types)

* [Step 5. Add URL handling code to your client app](#ios-facebook-url-handler)

### Step 1. Add Facebook SDK for iOS dependencies

To use Facebook's native SDK in your iOS app you must add the `PingExternalIdPFacebook` module to your client application. When added the Orchestration SDK for iOS knows to use its embedded native libraries for Apple, rather than using a redirect.

To add the `PingExternalIdPFacebook` module to your client application:

1. In Xcode, select your project, and navigate to **Targets** > **General** > **Frameworks, Libraries, and Embedded Content**.

2. Click **[icon: plus, set=fa]Add items**.

3. Select `PingExternalIdPFacebook.framework` and then click **Add**.

   The result resembles the following:

   ![Adding native IdP dependencies to an iOS project.](../../../_images/xcode-native-idp-framweorks.png)Figure 3. Adding native IdP dependencies to an iOS project

### Step 2. Connect your client iOS app to your Facebook App ID

When using the native Facebook SDK to perform social sign-on you must configure the client app with details of your app profile in Facebook.

To connect your client app with the app profile in Facebook:

1. Navigate to your project's `Info` property list.

2. Add the following property list strings, with values from the application you created in the [Meta Developer site](https://developers.facebook.com/).

   * *FacebookAppID*

     Click the **App ID** label in the header bar of the Meta Developer site for your app to copy the value.

   * *FacebookClientToken*

     In the Meta Developer site for your app, navigate to **App Settings** > **Advanced** > **Security**, and copy the **Client token** value.

     |   |                                                                                                        |
     | - | ------------------------------------------------------------------------------------------------------ |
     |   | Do not use the **App secret** value found in **App settings** > **Basic** in your client applications. |

   * *FacebookDisplayName*

     The name the client app displays when authenticating users.

   The result resembles the following:

   ![Configuring Facebook social sign-on properties in Xcode.](../../../_images/xcode-info-strings-facebook.png)Figure 4. Configuring Facebook social sign-on properties in Xcode

Learn more in [Facebook Login for iOS - Quickstart](https://developers.facebook.com/docs/facebook-login/ios) in the Meta Developers documentation.

### Step 3. Update your Facebook App ID to allow your client app to connect

You need to allow your client iOS app to connect to your Facebook App ID.

To allow your client app to connect, update your Facebook app in the Meta Developer console by adding the bundle ID of your client app:

1. In the [Meta for Developers](https://developers.facebook.com/apps/) console, select your app, and then navigate to **App Settings** > **Basic**.

2. If your app does not yet have a section for iOS apps, click **[icon: plus, set=fa]Add platform**, select **iOS**, and then click **Next**.

3. In the **iOS** section, in the Bundle ID field, enter the bundle identifier of your client app.

   For example, `com.pingidentity.PingExample`.

   |   |                                                                                                  |
   | - | ------------------------------------------------------------------------------------------------ |
   |   | To locate your bundle identifier in Xcode, navigate to **Targets** > **Signing & Capabilities**. |

4. Save your changes.

### Step 4. Associate Facebook redirect URIs with your client app

You must configure your app to respond to the redirect URI Facebook uses to return to your client app.

To add the redirect URI to your iOS app:

1. In Xcode, select your application and then navigate to **Targets** > **Info** > **URL Types**.

2. In the **URL Types** section, click **[icon: plus, set=fa]Add items**.

3. In **URL Schemes**, enter the string `fb`, followed by the app ID.

   For example, `fb1085352047332439`

   |   |                                                                                                                                                                                                                                                          |
   | - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | On the Meta developers site for your Facebook client you can obtain the information to enter in your iOS client app's `info.plist` file.On the site, select your app and navigate to **App settings** > **Basic** > **iOS**, then click **Quick Start**. |

### Step 5. Add URL handling code to your client app

After associating your client app with redirect URIs in the previous step, you must now add code that handles being opened after social sign-in.

Add the following code to the main application entry point:

1. Open your project's main application entry point, for example `ContentView`.

2. Add the following code to the `body` variable to call the Orchestration SDK-provided request handlers for Facebook and Google:

   ```swift
   WindowGroup {
       ContentView().onOpenURL { url in
           let handled = GoogleRequestHandler.handleOpenURL(UIApplication.shared, url: url, options: nil)
           if !handled {
               FacebookRequestHandler.handleOpenURL(UIApplication.shared, url: url, options: nil)
           }
       }
   }
   ```

   |   |                                                                                                |
   | - | ---------------------------------------------------------------------------------------------- |
   |   | The code handles URLs from both Google and Facebook clients.Edit the code if you only use one. |

## Implementing the Sign in with Google native SDK

To use Google's native SDK in your iOS app, you must complete the following tasks:

* [Step 1. Add Google SDK for iOS dependencies](#google-ios-dependencies)

* [Step 2. Create an iOS-specific client profile in Google](#google-ios-specific-client)

* [Step 3. Connect your client iOS app to your Google client profiles](#google-ios-specific-client-connection)

* [Step 4. Associate Google redirect URIs with your client app](#ios-google-url-types)

* [Step 5. Add URL handling code to your client app](#ios-google-url-handler)

### Step 1. Add Google SDK for iOS dependencies

To use Google's native SDK in your iOS app you must add the `PingExternalIdPGoogle` module to your client application. When added the Orchestration SDK for iOS knows to use native libraries for Apple, rather than using a redirect.

To add the `PingExternalIdPGoogle` module to your client application:

1. In Xcode, select your project, and navigate to **Targets** > **General** > **Frameworks, Libraries, and Embedded Content**.

2. Click **[icon: plus, set=fa]Add items**.

3. Select `PingExternalIdPGoogle.framework` and then click **Add**.

   The result resembles the following:

   ![Adding native IdP dependencies to an iOS project.](../../../_images/xcode-native-idp-framweorks.png)Figure 5. Adding native IdP dependencies to an iOS project

### Step 2. Create an iOS-specific client profile in Google

When using the native Google SDK for social sign-on, your client app communicates directly with Google, as well as with your PingOne server. You will already have one client app created in Google that your PingOne server uses.

You must create a set of iOS-specific credentials in Google so your client app can connect directly, as follows:

1. In a browser, navigate to the [Google's API Dashboard](https://console.cloud.google.com/apis/dashboard).

2. In the left navigation, click Credentials.

3. Click CREATE CREDENTIALS, and from the drop-down list, select `OAuth client ID`.

4. In the Application Type drop-down list, select `iOS`.

5. In the Name field, enter a name for your app.

6. In the Bundle ID field, enter the bundle identifier of your app.

   For example, `com.pingidentity.PingExample`.

   |   |                                                                                                  |
   | - | ------------------------------------------------------------------------------------------------ |
   |   | To locate your bundle identifier in Xcode, navigate to **Targets** > **Signing & Capabilities**. |

7. Click Create.

8. Select the client you just created from the list to view the details.

   The result will resemble the following:

   ![Configuring a client in Google for iOS.](../../../_images/google-ios-client.png)Figure 6. Configuring a client in Google for iOS

9. Make a note of the **Client ID** and **iOS URL scheme** values, as you need to use these in your client application.

### Step 3. Connect your client iOS app to your Google client profiles

You need to configure your iOS client app with the details of the iOS-specific client profile you created in Google, so that it can connect and authorize users.

You also need to configure your client with the ID of the client you created so that your PingOne server can communicate with Google.

This allows tokens granted to your client application by the iOS-specific client profile can also be used and introspected by your PingOne server, as the tokens will have both client IDs in the audience parameter.

To connect your app to the two clients you created in Google:

1. Navigate to your project's `Info` property list.

2. Add the following property list strings:

   * *GIDClientID*

     Specify the client ID of the iOS-specific client you created in Google.

   * *GIDServerClientID*

     Specify the client ID of the web application client you created in Google.

   The result resembles the following:

   ![Configuring Google social sign-on properties in Xcode.](../../../_images/xcode-info-strings-google.png)Figure 7. Configuring Google social sign-on properties in Xcode

### Step 4. Associate Google redirect URIs with your client app

You must configure your app to respond to the redirect URI Google uses to return to your client app.

To add the redirect URI to your iOS app:

1. In Xcode, select your application and then navigate to **Targets** > **Info** > **URL Types**.

2. In the **URL Types** section, click **[icon: plus, set=fa]Add items**.

3. In **URL Schemes**, enter the **iOS URL scheme** value from your iOS-specific client ID in Google.

   For example, `com.googleusercontent.apps.6846…​mahj`

   |   |                                                                                                                                                                                                                   |
   | - | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | To find your redirect URI, sign in to the [Google Auth Platform console](https://console.cloud.google.com/auth), and click **Clients**.Select your iOS-specific client, and copy the value of **iOS URL scheme**. |

### Step 5. Add URL handling code to your client app

After associating your client app with redirect URIs in the previous step, you must now add code that handles being opened after social sign-in.

Add the following code to the main application entry point:

1. Open your project's main application entry point, for example `ContentView`.

2. Add the following code to the `body` variable to call the Orchestration SDK-provided request handlers for Facebook and Google:

   ```swift
   WindowGroup {
       ContentView().onOpenURL { url in
           let handled = GoogleRequestHandler.handleOpenURL(UIApplication.shared, url: url, options: nil)
           if !handled {
               FacebookRequestHandler.handleOpenURL(UIApplication.shared, url: url, options: nil)
           }
       }
   }
   ```

   |   |                                                                                                |
   | - | ---------------------------------------------------------------------------------------------- |
   |   | The code handles URLs from both Google and Facebook clients.Edit the code if you only use one. |
