Join Ron Buencamino for an in-depth discussion in this video Handle deferred transactions, part of Implementing In-App Purchases in iOS 10 with Swift 3.
- [Presenter] One payment transaction state…that we're going to need to be sure to handle…is the deferred transaction state.…This state has been around since iOS 8…and it's the status that's called…to denote when a transaction is still in the queue,…but is pending external action of some sort,…such as the ask to buy feature…that's found with iTunes family accounts.…Now, in this state, a transaction…will remain in a queue indefinitely…and you will see your final status…via another callback to payment queue…updated transactions at a later time.…
Now because we don't know when this callback is going to occur,…you don't want to block your UI…in response to this status.…You could inadvertently leave your app…unusable for a good amount of time.…To simulate a payment request…that'll trigger a deferred payment transaction,…you want to set the simulatesAskToBuyInSandbox flag…of your SKMutablePayment.…And doing so will return a transaction…to the callback with the deferred status.…You should then make your app respond accordingly.…
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