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

iOS Integration Guidelines

Integration Steps

On iOS, integrating the Hosted Payment Page involves four steps:

  1. Initiating a payment request on your backend

  2. Opening the Hosted Page in the device browser

  3. Handling the redirect back into your app

  4. Confirming the transaction status.

1. Initiate Payment Request

Your backend calls Codapay’s Payment/init API to create a transaction and uses the returned txnId to build the Hosted Page URL:

Sandbox

https://sandbox.codapayments.com/airtime/begin?browser_type=mobile-web&txn_id={txnId}

Production

https://airtime.codapayments.com/airtime/begin?browser_type=mobile-web&txn_id={txnId}

Return this URL to your app.

See Initiate Payment Request for full parameter list and examples

2. Display Hosted Payment Page

From your iOS app, open the Hosted Page URL in the system's default browser

See Display Hosted Page for URL formats and additional details

3. Redirect URLs

After payment success or failure, Codapay redirects the user to your configured Redirect URL. On iOS, you need to capture this redirect and return the user into your app session.

Two options are available:

  • Universal Links (recommended) – Provide the smoothest user experience and better security.

  • Custom URL Schemes (alternative) – Simpler to implement, but can be intercepted and are less reliable.

See how to set up Redirect URLs on Coda portal and configuration examples

Detailed iOS setup steps are available in the Implementation Details section below

4. Check Payment Status

Do not rely only on the redirect URL, since it can be forged. Always check the actual status with Codapay.

  • Webhook notification (recommended): Codapay sends the final result to your backend.

  • Inquiry API: If the webhook has not yet been received, your backend can query the transaction status.

Best practice:

  1. Codapay sends webhook notification to your backend.

  2. Browser redirects user back into the app (Universal Link or scheme).

  3. App queries backend for the result.

  4. Backend updates the user’s inventory or entitlements.

See Transaction Status Notifications and Check Payment Status in the general documentation for specifications and examples

Implementation Details

This section provides the step-by-step configuration needed to support redirects on iOS. Use this if you need the full Apple setup.

  1. Configure Associated Domains in your Apple Developer account:

    1. In Apple Developer, create or edit your App Identifier and enable Associated Domains.

    2. Note your Team ID and Bundle ID — together they form the App ID you will declare in the JSON file.

  2. Create and host apple-app-site-association on your domain

    1. Define the file content using your App ID (Team ID + Bundle ID) and the URL paths you want to match (e.g., success, pending, failure). See an example below.

    2. Save the file exactly as apple-app-site-association

    3. Upload the file to https://<your-domain>/.well-known/apple-app-site-association

Example:

  1. Enable Associated Domains in Xcode: In Signing & Capabilities, add Associated Domains and register your domain with the applinks: prefix

  2. Handle Universal Links in the app

AppDelegate (iOS ≤12)
SceneDelegate (iOS 13+)
SwiftUI

Custom URL Schemes (alternative)

  1. Register the scheme in Info.plist

Add your custom scheme under CFBundleURLTypes

Example:

  1. Handle the scheme in the app

AppDelegate (iOS ≤12)
SceneDelegate (iOS 13+)
SwiftUI

Last updated

Was this helpful?