Environment
- iOS 18.1+
- StoreKit External Purchase Link Entitlement (EU)
- App distributed via App Store in France
Problem Summary
I'm implementing external purchase links for EU users using ExternalPurchaseCustomLink. While the implementation works correctly in my TestFlight testing, some production users experience token(for:) returning nil.
Implementation
Following Apple's documentation, my flow is:
- Check eligibility using
ExternalPurchaseCustomLink.isEligible - If eligible, call
ExternalPurchaseCustomLink.token(for: "ACQUISITION") - Store the token for use in the external purchase flow
// Simplified implementation
guard #available(iOS 18.1, *) else { return }
let isEligible = await ExternalPurchaseCustomLink.isEligible
guard isEligible else { return }
// This returns nil for some users despite isEligible being true
let token = try await ExternalPurchaseCustomLink.token(for: "ACQUISITION")
Configuration
- Entitlement:
com.apple.developer.storekit.external-purchase-linkis present - Info.plist:
SKExternalPurchaseCustomLinkRegionsset to["fr"] - App is only available in France via App Store
Observed Behavior
For affected users:
ExternalPurchaseCustomLink.isEligiblereturnstruetoken(for:)returnsnil(not throwing an error)- The token generation was never previously called for these users
Questions
- Under what conditions does
token(for:)returnnilwhenisEligibleistrue? - Is there additional validation I should perform before calling
token(for:)? - Are there known issues with token generation on specific iOS versions?
Any guidance on debugging this issue would be appreciated.