Join Ron Buencamino for an in-depth discussion in this video Handling deferred payments, part of Implementing In-App Purchases in iOS 11 with StoreKit.
- [Instructor] One payment transaction state…that we need to be sure to handle…is the deferred transaction state.…This state has been around since iOS 8,…and is the status that's called to denote…when a transaction is in the queue…but is pending external action of some sort,…such as the Ask to Buy feature…found with an iTunes family account.…Now, in this state,…a transaction will remain in the queue indefinitely,…and you'll receive the final status…via another call back to payment queue updated transactions.…
Because of this, you shouldn't block your UI…in response to this status.…You could leave your app unusable for a good amount of time.…To simulate a request that will trigger…the deferred payment transaction state,…you want to set the simulatesAskToBuyInSandbox flag…of your SKMutablePayment.…Doing so will return a transaction to the call back…in a deferred status.…You should then make your app respond accordingly.…
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