Skip to main content

1.3.6 - ExternalPurchaseCustomLink API Types (iOS 18.1+)

· 2 min read
Hyo

This release syncs with OpenIAP gql v1.3.16 / google v1.3.27 / apple v1.3.14.

New Types

New types for the ExternalPurchaseCustomLink API that allows apps to link users to external purchase flows with proper disclosure:

// Notice type for external purchase custom link
val noticeType = ExternalPurchaseCustomLinkNoticeTypeIOS.Browser

// Token types for external purchase reporting
val acquisitionType = ExternalPurchaseCustomLinkTokenTypeIOS.Acquisition
val servicesType = ExternalPurchaseCustomLinkTokenTypeIOS.Services

// Result types
val noticeResult = ExternalPurchaseCustomLinkNoticeResultIOS(
continued = true,
error = null
)

val tokenResult = ExternalPurchaseCustomLinkTokenResultIOS(
token = "external_purchase_token",
error = null
)

New API Methods (iOS 18.1+)

The following API methods are now available for iOS 18.1+:

// Check eligibility
val isEligible = kmpIapInstance.isEligibleForExternalPurchaseCustomLinkIOS()

// Show notice and get user consent
val noticeResult = kmpIapInstance.showExternalPurchaseCustomLinkNoticeIOS(
ExternalPurchaseCustomLinkNoticeTypeIOS.Browser
)
if (noticeResult.continued) {
// User agreed to continue to external purchase
}

// Get token for reporting to Apple
val tokenResult = kmpIapInstance.getExternalPurchaseCustomLinkTokenIOS(
ExternalPurchaseCustomLinkTokenTypeIOS.Acquisition
)
if (tokenResult.token != null) {
// Report to Apple's External Purchase Server API
}

Note: These APIs require iOS 18.1 or later. Apps targeting earlier iOS versions should check isEligibleForExternalPurchaseCustomLinkIOS() before using these features.

Documentation Fixes

iOS ExternalPurchase API Version Correction

Fixed the documented iOS version requirement for ExternalPurchase APIs from iOS 15.4+ to iOS 17.4+:

  • canPresentExternalPurchaseNoticeIOS() - iOS 17.4+
  • presentExternalPurchaseNoticeSheetIOS() - iOS 17.4+
  • presentExternalPurchaseLinkIOS() - iOS 17.4+

New Types Summary

TypePlatformDescription
ExternalPurchaseCustomLinkNoticeTypeIOSiOS 18.1+Notice type enum (Browser)
ExternalPurchaseCustomLinkTokenTypeIOSiOS 18.1+Token type enum (Acquisition, Services)
ExternalPurchaseCustomLinkNoticeResultIOSiOS 18.1+Result of showing notice sheet
ExternalPurchaseCustomLinkTokenResultIOSiOS 18.1+Result of token request

OpenIAP Versions

PackageVersion
openiap-gql1.3.16
openiap-google1.3.27
openiap-apple1.3.14

Installation

implementation("io.github.hyochan:kmp-iap:1.3.6")

References