> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appcharge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate with iOS

This article explains how to integrate Unity Payment Links with the iOS platform.

> [!WARNING]
>
> On some Unity versions, the **Back to Game** button won't return players to the game after checkout. See [Fix deeplinks on affected Unity versions](#fix-deeplinks-on-affected-unity-versions) to check whether your version is affected, and if so, complete the `Info.plist` workaround.

To integrate with iOS:

1. Go to the **Build Settings** window and make sure your Unity project is set to **iOS**. Once set, the `AppchargeConfig` file updates to display iOS-specific configuration options.

   ![iOS Build Settings](https://mintcdn.com/appcharge/pgQNefK6v2mrfKWg/images/sdks/unity/config_ios_main.png?fit=max\&auto=format\&n=pgQNefK6v2mrfKWg\&q=85\&s=9025e6c5c63c0fbd18b1e7dd482661be)

2. Your configuration settings should look like this:

   ![iOS Configurations](https://mintcdn.com/appcharge/aHvkQM4kEbqf_uft/images/sdks/unity/unity-for-ios-config.png?fit=max\&auto=format\&n=aHvkQM4kEbqf_uft\&q=85\&s=a087864e0d55b455a0986a62452bc596)

   > [!NOTE]
   >
   > By default, the configuration file is preconfigured for integration. However, you must set the required **Environment** and **Checkout Public Key** fields under **Publisher Info**.

   ## Publisher Info

   > [!NOTE]
   >
   > These settings can also be changed at runtime, but doing so requires [re-initializing the SDK](https://docs.appcharge.com/sdks/payment-links/unity/initialize-the-payment-links-sdk.md#re-initialize-the-sdk).

   | Property | Type | Description |
   | - | - | - |
   | Environment | `Enum` | Sets the checkout environment. Use `Sandbox` for testing and `Production` for live payments. |
   | Checkout Public Key | `String` | Defines the checkout public key. You can find it by going to the **Publisher Dashboard → Settings → Integration**. |

   ## Configuration Settings

   | Property | Type | Description |
   | - | - | - |
   | Enable Main Thread Dispatcher | `Boolean` | The SDK works outside of the Unity main thread. This option allows you to wrap callback methods with Unity main thread. |
   | Enable Debug Mode | `Boolean` | When enabled, prints a summary of automatic integration changes after the build completes. |
   | Browser Mode | `Enum` | Sets current browser mode: `External` for opening default browser or `Internal` for embedded Safari. |
   | Associated Domain | `String` | Specifies the domain used to redirect players back to your game (without the HTTP protocol). Example: `my.best-app.com`. The domain must be served via **https**, not **http**. |
   | Portrait Orientation Lock | `Boolean` | Force the internal browser to open in portrait mode even if the application is set to landscape.   **Note:** You can update this property programmatically before launching the checkout. |

   ## Integration Settings

   Enables automatic integration of required iOS frameworks, entitlements, and URL schemes during the Xcode build process.

   > [!WARNING]
   >
   > Use the following options to exclude parts of the build process. By doing so, you may need to implement part of the process manually.

   | Property | Type | Description |
   | - | - | - |
   | Enable Integration Options | `Boolean` | Determines whether the SDK automatically applies required Xcode configurations during build. If disabled, you’ll need to configure them manually in Xcode. |

   > [!WARNING]
   >
   > Disabling **Enable Integration Options** prevents the automatic configuration required for the Checkout SDK from functioning correctly. If disabled, you must manually configure each required file in Xcode.

   ### Enable iOS Framework Integration

   By default, the SDK configures Swift libraries, runpaths, signing, and adds the Appcharge XCFramework during the Xcode build. Use the options below to skip parts of that setup if you manage them yourself.

   | Property | Type | Description |
   | - | - | - |
   | Enable iOS Framework Integration | `Boolean` | Determines whether the SDK automatically applies framework integration during the Xcode build. |
   | Exclude Set Swift Standard Libraries For Framework | `Boolean` | Skips configuring Swift standard libraries for embedded frameworks. |
   | Exclude Set LD Runpath Search Paths | `Boolean` | Prevents modifying `LD_RUNPATH_SEARCH_PATHS` for framework loading. |
   | Exclude Set Swift Version | `Boolean` | Skips setting the Swift language version for the framework target. |
   | Exclude Set Swift Standard Libraries For Main | `Boolean` | Prevents configuring Swift standard libraries for the main app target. |
   | Exclude Set Code Sign Entitlements | `Boolean` | Skips modifying code signing entitlements related to framework integration. |
   | Exclude Set Code Sign Style | `Boolean` | Prevents changes to the code signing style (Automatic/Manual). |
   | Exclude Add XC Framework | `Boolean` | Skips adding the Appcharge XCFramework to the Xcode project. |

   ### Enable iOS Entitlements Integration

   By default, the SDK creates or updates the entitlements file and associated domains during the Xcode build. Use the options below to skip parts of that setup if you manage them yourself.

   | Property | Type | Description |
   | - | - | - |
   | Enable iOS Entitlements Integration | `Boolean` | Determines whether the SDK automatically applies entitlements integration during the Xcode build. |
   | Exclude Create Entitlements File | `Boolean` | Skips creating or modifying the app entitlements (`.entitlements`) file. |
   | Exclude Create Associated Domains Key | `Boolean` | Prevents adding the `com.apple.developer.associated-domains` key to the entitlements file. |
   | Exclude Add Associated Domain | `Boolean` | Skips adding the Appcharge associated domain value to the entitlements configuration. |

   ### Enable iOS URL Scheme Integration

   By default, the SDK adds the Appcharge URL scheme entries to `Info.plist` during the Xcode build. Use the options below to skip parts of that setup if you manage them yourself.

   | Property | Type | Description |
   | - | - | - |
   | Enable iOS URL Scheme Integration | `Boolean` | Determines whether the SDK automatically applies URL scheme integration during the Xcode build. |
   | Exclude Set URL Scheme Type Role | `Boolean` | Skips setting the URL scheme type role (e.g., Viewer/Editor) in the app’s Info.plist. |
   | Exclude Set URL Scheme Name | `Boolean` | Prevents setting or modifying the URL scheme display name in the Info.plist. |
   | Exclude Add URL Scheme | `Boolean` | Skips adding the Appcharge URL scheme entry to the app’s URL types configuration. |

## Fix deeplinks on affected Unity versions

Some Unity versions add a `UIApplicationSceneManifest` key to `Info.plist`. This prevents `Application.deepLinkActivated`, which the Payment Links SDK uses to return players to the game after checkout.

Known affected Unity versions:

* `2022.3.75f1`
* `6000.0.68f1`
* `6000.0.69f1`
* `6000.3.10f1`
* `6000.4.0b11`
* `6000.5.0a7`
* `6000.6.0a1`

If you're using one of these versions, after each iOS build open `Info.plist` in the generated Xcode project and remove the `UIApplicationSceneManifest` key and its contents. Unity regenerates `Info.plist` on each build, so repeat this workaround after every iOS build.

> [!NOTE]
>
> Unity `6000.3.78f1` or later includes the official fix. You can upgrade instead of applying the `Info.plist` workaround. Test the upgrade thoroughly before releasing.
