Question

How can i configure storekit to purchase more than 1 product in a single transaction.

Requirement: 1 credit = 1 product.

In my application i want to give option to user to buy 5 credits.

Thanks in Advance

Was it helpful?

Solution

Found an answer from iOS documentation!

We can make use of SKMutablePayment and we can configure its property quantity The number of items the user wants to purchase.

@property(nonatomic, readwrite) NSInteger quantity

Discussion The quantity property must be greater than 0. Available in iOS 3.0 and later. Declared In SKPayment.h

OTHER TIPS

Create an InApp purchase object that gives the user 5 credits.... So:

Buy 1 credit

Buy 5 credits

Buy 10 credits


Three separate consumable product IDs.

One inApp product is one transaction.

As each transaction is stored on the server and can be validated, you cannot purchase 5 products in single transaction. It has to be 5 transactions.

you have to add 5 SKProducts into a queue. and in your completed transactions. keep count of how many products purchased and in the end show updated value.

The solution is as mentioned above getting a mutableCopy of the SKPayment and setting the quantity property to the desired value. However note that the maximum value is 10, this is not mentioned in the docs of SKMutablePayment but only in SKPayment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top