Use this page with AI

Copy this into your coding assistant and add your request.

Read https://openiap.dev/docs/apis/ios/present-external-purchase-link-ios and https://openiap.dev/llms.txt. Follow the reading instructions, detailed reference, and linked guides relevant to my task before making changes.
Inspect my existing project and reuse its framework and conventions. Ask me for missing product decisions. Implement the requested behavior and run the applicable checks.
Show the working result, the commands and actual test results, and any remaining limitations. Keep your explanation brief.

My request: [describe what customers should be able to do]
See an example request →

iOS presentExternalPurchaseLinkIOS

Open an external purchase URL outside the app (iOS 16+).

Opens the URL via UIApplication.open(_:options:completionHandler:) after a canOpenURL guard — the openiap-apple implementation routes through UIKit rather than StoreKit's ExternalPurchaseLink API. The native call must still be gated by the StoreKit external-purchase entitlement on production builds. See the Apple UIApplication.open reference.

Signature

swift
func presentExternalPurchaseLinkIOS(_ url: String) async throws -> ExternalPurchaseLinkResultIOS

struct ExternalPurchaseLinkResultIOS {
    let error: String?
    let success: Bool
}

Parameters#

  • url (required, string) — External purchase URL to present.

Returns#

Promise<ExternalPurchaseLinkResultIOS> — carries the result of opening the external link (success flag + any error message).

Example

swift
let result = try await OpenIapModule.shared.presentExternalPurchaseLinkIOS("https://yourstore.com/checkout")