views:

54

answers:

2

Hi. I am developing a iPhone app. For that i have successfully add the In App Purchase functionality. It is working perfectly for a single item purchase. My problem is that How can i do this for multiple item purchase with single purchase request to App Store? Can anybody help me for this?

A: 

Each purchase needs authorization from the user, so I don't think you can do what you want to.

However, you can make a single in-app purchase which is priced and behaves like multiple items clubbed together. For instance:

  • Item 1 - $.99
  • Item 2 - $.99
  • Item 3 - $.99
  • Bundle (includes 1, 2, 3) - $1.99
psychotik
A: 

You can use quantity property in SKPayment... Read how many items you want from user then pass this value to payment.quantity(By default it is 1).

SKPayment *payment = [SKPayment paymentWithProductIdentifier:inProductID];
payment.quantity = mNoOfItemsYouWant;
[[SKPaymentQueue defaultQueue]addTransactionObserver:mTransactionObserver];
[[SKPaymentQueue defaultQueue] addPayment:payment];
Chandan Shetty SP
Hi Chandan, thanks for reply. I have tried your solution but it gives error forpayment.quantity = 4 as "Object can not be set - either readonly property or no setter found.Can you please explain why is it showing above error?
Shakti
Hi Chandan,I found the solution why that error was coming.I just replace SKPayment with SKMutablePayment. and it works.
Shakti