Join Ron Buencamino for an in-depth discussion in this video Receipt validation, part of Implementing In-App Purchases in iOS 10 with Swift 3.
- [Instructor] Currently, our app finishes a transaction…once a purchase is complete.…Now while this works, we need to do more due diligence…to verify that the purchase wasn't falsely made.…Now to do this, we'll need to understand…the App Store receipt that's returned to us…when we complete a purchase.…The App Store Receipt is a trusted record…of 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 that app…on a particular date.…
It's stored right in the app container,…and you can access it using the NSBundle API.…Just look for the main bundles App Store URL property.…You can take that data and create…an NSData object out of it,…to work with the receipt binary.…The receipt is issued by Apple,…and again, it's for just that specific device only.…The receipt is issued at the time of purchase,…and is renewable for certain types of in-app purchases.…
Consumable, or non-renewable subscriptions…will not appear on a refreshed app receipt.…
First, learn what you can legitimately offer for sale in the App Store. Apple's guidelines restrict the sale of certain products, including real-world goods. Next, learn how to configure new products for sale with iTunes Connect and retrieve the product information in your app. Ron then shows how to request and process payments, and deliver the user's purchases to their iOS device. Plus, learn about selling subscriptions and restoring purchased content—a smart strategy for keeping your app rating high.
- What you can and can't sell in the App Store
- Looking at StoreKit
- Creating products in iTunes Connect
- Presenting products in your storefront
- Requesting payments in your app
- Processing transactions
- Delivering products
- Persisting purchases and auto-renewed subscriptions
- Restoring purchased content