iOS 应用内支付开发与实现 IAP - In App Purchase

原创
2016/07/06 12:26
阅读数 198

Getting started with IAP

https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/Introduction.html

About IAP

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction.html

IAP Guideline

https://developer.apple.com/in-app-purchase/In-App-Purchase-Guidelines.pdf

APP review guideline

https://developer.apple.com/app-store/review/guidelines

消费型IAP开发checklist

Implementation Checklist

Before you submit your app for review, verify that you’ve implemented all of the required behavior. Make sure you’ve implemented the following core In-App Purchase behavior (listed in order of a typical development process):

  • Create and configure products in iTunes Connect.

    You can change your products throughout the process, but you need at least one product configured before you can test any code.

  • Get a list of product identifiers, either from the app bundle or your own server. Send that list to the App Store using an instance ofSKProductsRequest.

  • Implement a user interface for your app’s store, using the instances of SKProduct returned by the App Store. Start with a simple interface during development, such as a table view or a few buttons.

    Implement a final user interface for your app’s store at whatever point makes sense in your development process.

  • Request payment by adding an instance of SKPayment to the transaction queue using the addPayment: method of SKPaymentQueue.

  • Implement a transaction queue observer, starting with the paymentQueue:updatedTransactions: method.

    Implement the other methods in the SKPaymentTransactionObserver protocol at whatever point makes sense in your development process.

  • Deliver the purchased product by making a persistent record of the purchase for future launches, downloading any associated content, and finally calling the finishTransaction: method of SKPaymentQueue.

    During development, you can implement a trivial version of this code at first—for example, simply displaying “Product Delivered” on the screen—and then implement the real version at whatever point makes sense in your development process.

update 2016.11.23 Invalid receipt. Status code: 21002 的原因是提交的订单数据格式不对,订单数据是个json格式,{"receipt-data":"base64编码的二进制数据"}

参考

http://www.cocoachina.com/industry/20130313/5814.html

展开阅读全文
IAP
加载中

作者的其它热门文章

打赏
0
1 收藏
分享
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部