Join Ron Buencamino for an in-depth discussion in this video Restoring purchases, part of Implementing In-App Purchases in iOS 11 with StoreKit.
- [Instructor] There will be times…where your users need to reinstall your app…either they experienced a bug where the fix is to reinstall…or they just chose to uninstall it…and later on will decide to reinstall it.…Whatever the case, if a user purchases something…that they expect to continue to have around,…like for instance a filter for their app,…then they would be a bit disappointed…if they went back to your app…and wasn't able to restore their previous purchase.…Lucky for us, Apple makes this real easy.…All we need to do is come over here to IAP Manager…and let's come down to the bottom of our class…and we're going to mark off a section for restoring purchases.…
I'm going to create a function called restorePreviousPurchases.…In here, I'm simply going to call SKPaymentQueue,…the default queue, and in there they have a function called…restoreCompletedTransactions and what this does…is it goes to the App Store…and it downloads the latest receipt…and it gives you that receipt…so that you can then process it…
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