This article describes how to set up the iOS Mobile Checkout SDK for Native iOS.

To allow players to return to your game after completing checkout in an external browser, such as Safari, you need to set up a Universal Link.

In Xcode:

  1. Open your project and select your main project file.

  2. Go to the Signing & Capabilities tab.

  3. Click + Capability and search for Associated Domains. If you don’t see it, ensure you’re using a real device configuration.

  4. Under Domains, add:

    applinks:{YOUR_DOMAIN}
    

    For example:

    applinks:my-best-game.com
    

Step 2 | Set up a URL scheme

URL schemes allow your app to handle redirects from an in-app browser or embedded checkout flow.

In Xcode:

  1. Open your project, select your target, and navigate to the info.plist file.

  2. In the Information Property List, expand the URL types section. If it doesn’t exist, create it by clicking +.

  3. Add an Item section if none exists, and set it to the following:

    • URL identifier: action
    • URL Schemes: acnative-${PRODUCT_BUNDLE_IDENTIFIER}

Step 3 | Import the SDK

To integrate the iOS Mobile Checkout SDK:

  1. Drag the provided .framework file into your Xcode project navigator.
  2. In the popup, make sure Copy items if needed is checked.
  3. Select your target and go to the General tab -> Frameworks, Libraries, and Embedded Content. Set the SDK to Embed & Sign.

After a player completes a purchase or exits the checkout in Safari, they’ll be redirected back to your app via a deeplink. Your app must capture this URL and forward it to the Appcharge SDK to finalize the transaction.

If your app handles deeplinks, make sure to call the Bridge handleDeeplink method inside your existing handlers to pass the URL to the Appcharge SDK.

If your app doesn’t already handle deeplinks, add the following methods in your SceneDelegate:

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
    guard let url = URLContexts.first?.url else { return }
    ACBridgeAPI.handleDeepLink(url)
}
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
    if userActivity.activityType == NSUserActivityTypeBrowsingWeb,
       let url = userActivity.webpageURL {
        ACBridgeAPI.handleDeepLink(url)
    }
}