Join Ron Buencamino for an in-depth discussion in this video Understanding receipt validation, part of Implementing In-App Purchases in iOS 11 with StoreKit.
- [Instructor] When the purchase process is complete,…the tendency in followup actions would be to go ahead…and deliver the purchased product to the user.…Now, while this works, it would be wise…to do more due diligence and verify…that the purchase wasn't falsely made.…To accomplish this, we'll need to understand…the App-Store receipt that's returned to us…at the completion of a purchase.…The App-Store receipt is the receipt…that is a trusted record of all app and in-app purchases.…It lists that an app was purchased on a particular date…for that specific device.…
It also lists any in-app purchases…that were purchased for an app on a particular date.…Now, this receipt is stored right in the app container,…and you can access it by going…to Bundle.main().appStoreReceiptUrl.…Now, to use it, you want to pass the URL…to a NS-data object so that you can get its binary.…The App-Store receipt is issued by Apple,…and it's issued for a specific device only.…The receipt is issued at the time of purchase…and is renewable for certain types of in-app purchases.…
First, get an overview of StoreKit and the types of purchases you can offer, including consumable and non-consumable products and non-renewing and auto-renewable subscriptions. Next, learn how to configure new products for sale with iTunes Connect and display a storefront right within your app. Ron then shows how to request and process payments, and deliver users' purchases to their iOS devices. Plus, learn about restoring purchased content—a smart strategy for keeping your app rating high—and requesting reviews from users using the new SKStoreReviewController API, which doesn't require leaving the app.
- What is StoreKit?
- Creating products in iTunes Connect
- Displaying products in your storefront
- Requesting payments
- Receipt validation
- Delivering products
- Restoring purchased content
- Asking for app reviews