Join Ron Buencamino for an in-depth discussion in this video Requesting payment with SKProductRequest, part of Implementing In-App Purchases in iOS 11 with StoreKit.
- [Instructor] We last left off with being able…to see our product list, so in this lesson,…we're going to discuss handling user interaction…should they tap on an item that they want to purchase.…First, I want to come over to IAPManager.swift.…I'm going to jump down over here and mark off…a section for our payment object.…
In here, what I want to do is create a function…called create Payment Request For Product,…and what we're going to do with this function…is take in an SKProduct, and in turn,…create an SKMutable payment off of it.…So what I'm going to do in this function is…I'm going to create the SKMutable payment,…I'm going to set it's quantity, and then I'm…going to add it to the payment queue.…So, let me go ahead and do that right now.…So taking a look at what I did over here,…starting on line 58, we create the SKMutable Payment…and this requires an SKProduct to wrap itself around,…so we're taking in the argument and setting it here.…
Line 59, I'm setting a quantity equal to one.…Now, you can dynamically assign this down the line,…
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