For purchasing a product in StoreKit 2, Apple has the below API with appAccountToken
let userId = UUID()
Product.purchase(options: [.appAccountToken(userId)])
However there seems no way to feed in an appAccountToken to associate app users with Apple ID users when redeeming offer codes.
In Apple documentation, the below is for presenting a redeem code sheet. https://developer.apple.com/documentation/storekit/appstore/3954431-presentoffercoderedeemsheet
if let windowScene = await UIApplication.shared.connectedScenes.first as? UIWindowScene {
try await StoreKit.AppStore.presentOfferCodeRedeemSheet(in: windowScene)
}
The above API does not accept appAccountToken. Did I missing anything or there is no way to do it?
Thanks in advance!