Use this page with AI
Copy this into your coding assistant and add your request.
Read https://openiap.dev/docs/apis/ios/get-external-purchase-custom-link-token-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]iOS getExternalPurchaseCustomLinkTokenIOS
Fetch an external-purchase token for the ExternalPurchaseCustomLink API (iOS 18.1+, macOS 15.1+). Pair the returned token with Apple's External Purchase Server API to report acquisition or services transactions.
Wraps ExternalPurchaseCustomLink.token(for:) — token to report transactions to Apple's External Purchase Server. iOS 18.1+, macOS 15.1+. See the Apple StoreKit reference.
Signature
func getExternalPurchaseCustomLinkTokenIOS(
_ tokenType: ExternalPurchaseCustomLinkTokenTypeIOS
) async throws -> ExternalPurchaseCustomLinkTokenResultIOSParameters#
tokenType(required,ExternalPurchaseCustomLinkTokenTypeIOS) —acquisition(new customers) orservices(existing customers).
Returns#
Promise<ExternalPurchaseCustomLinkTokenResultIOS> — an optional opaque token plus an optional error. Send a returned token to Apple's External Purchase Server API.
Example
let token = try await OpenIapModule.shared.getExternalPurchaseCustomLinkTokenIOS(
.acquisition
)tokenType is ExternalPurchaseCustomLinkTokenTypeIOS.Acquisition for new customers or ExternalPurchaseCustomLinkTokenTypeIOS.Services for existing ones. The result contains the opaque token or an error.