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 string from StoreKit).
Example
swift
let result = try await OpenIapModule.shared.presentExternalPurchaseLinkIOS("https://yourstore.com/checkout")