From the course: Implementing In-App Purchases in iOS 11 with StoreKit
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Restoring purchases
From the course: Implementing In-App Purchases in iOS 11 with StoreKit
Restoring purchases
- [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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Project overview3m 56s
-
Creating products in iTunes8m 8s
-
Implementing SKProductsRequestDelegate1m 55s
-
Making a product request4m 52s
-
Displaying SKProducts in a storefront3m 28s
-
Requesting payment with SKProductRequest3m 47s
-
Understanding the payment queue1m 20s
-
Implementing SKPaymentQueue6m 39s
-
Understanding receipt validation7m 17s
-
Receipt validation11m 22s
-
Unlock content in validated receipts14m 55s
-
Delivering a product18m 27s
-
Handling deferred payments59s
-
Restoring purchases5m 10s
-
-
-