Skip to content

Instantly share code, notes, and snippets.

@thebusby
Created February 7, 2025 06:29
Show Gist options
  • Save thebusby/72c51970c971ef4b725f754707edf5e6 to your computer and use it in GitHub Desktop.
Save thebusby/72c51970c971ef4b725f754707edf5e6 to your computer and use it in GitHub Desktop.
An example of how to use an appAccountToken with a SubscriptionStoreView
SubscriptionStoreView(groupID: INAPP_SUBSCRIPTION_GROUP_ID) {
// View goes here
}
.inAppPurchaseOptions({ product in
var options: Set<Product.PurchaseOption> = []
let appAccountToken = UUID() // Create one, or get from another source
options.insert( .appAccountToken(appAccountToken) )
return options
})
}
@thebusby
Copy link
Author

thebusby commented Feb 7, 2025

Being new to iOS development, I'm assuming that I'm missing something here; but for the life of me I had a horrific time figuring out how to use an appAccountToken with a SubscriptionStoreView in iOS's StoreKit. I can just send my user's UUID in the purchase transaction, and have my server handle everything independently on the back end. Why wouldn't I want to do that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment