开发者

In App Purchase for iPhone

开发者 https://www.devze.com 2023-01-06 14:34 出处:网络
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 t

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?


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];


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号