iOS應用IAP設定總結

來源:互聯網
上載者:User

標籤:des   blog   class   code   tar   c   

iOS應用調置

wjforstudy分享了IAP的一些基本知識。在論壇的地址是:http://www.cocoachina.com/bbs/read.php?tid=92060 

 1.在開始IAP開發前,先要對IAP有個大概的瞭解,下面這片文章就是給你預備的:
  蘋果的官方文檔:Store Kit Guide(In App Purchase)
    現在網上已經有對這個文檔很成熟的翻譯了,如果想加快閱讀速度,看這裡
    翻譯版本:http://yarin.blog.51cto.com/1130898/549141

    PS:開始IAP開發並不需要多深的背景知識,這裡囫圇看下去就可以了。但是要瞭解IAP的兩種驗證形式: 裝置驗證和伺服器驗證


2.網上流傳比較廣的IAP開發流程的文章,講的範圍很全面,但是有的內容跟不上時代了,一共有兩點需要注意:
  一、在現在的IAP測試中,已經不需要提交程式再讓開發人員把程式狀態設定“Developer Reject”了,只需要程式      到”prepare for upload“就可以了。
二、在IOS5,已經可以在模擬器中測試,調試IAP這個功能了。
    這一篇文章地址是:
  IAP(程式內購買): 完全攻略 
    http://fei263.blog.163.com/blog/static/927937242011321105241823/
    這篇文章包含了從建立APP ID 開始到IAP準系統實現的整個流程,很全面,值得花時間去看一看,但是注意幾個問題:
    1.文中有幾個前置條件沒有說明:
<1 在添加Test User之前,應該已經設定好ITunes Connect賬戶中關於Purchase Contract的資訊。至少應該點擊contract 的request按鈕,讓contract置於pending in process的狀態。
     完成上面的操作後,你才會在剛進入Manage User介面的時候,能選擇建立Test User。


3.請保證這個時候你的pruchase contract已經完成了!contract中的 bank info,tax info,contact info都需要填寫完成!
   這篇文章是這裡要推薦的,主要介紹了Itunes Connect中建立了程式資訊後,IAP的準備和測試的過程:
【iOS開發必收藏】詳解iOS應用程式內使用IAP/StoreKit付費、沙箱(SandBox)測試、建立測試帳號流程!
http://blog.csdn.net/xiaominghimi/article/details/6937097


4.遇到問題了?
好了,經過前面的準備後,就到了真正和IAP聯通的步驟了。在輸入一個Product ID向伺服器發起request的時候,很有可能出現失敗的情況,在request屬性InvalidateIdentifier中,你會發現這個Product ID是無效的。
為什麼呢?蘋果是不會告訴你的,連個錯誤代碼都沒有,非常坑爹。
所以這裡我們有一個Check List,需要大家逐條檢查:
Have you enabled In-App Purchases for your App ID?
Have you checked Cleared for Sale for your product?
Have you submitted (and optionally rejected) your application binary?
Does your project’s .plist Bundle ID match your App ID?
Have you generated and installed a new provisioning profile for the new App ID?
Have you configured your project to code sign using this new provisioning profile?
Are you building for iPhone OS 3.0 or above?
Are you using the full product ID when when making an SKProductRequest?
Have you waited several hours since adding your product to iTunes Connect?
Are your bank details active on iTunes Connect? (via Mark)
Have you tried deleting the app from your device and reinstalling? (via Hector, S3B, Alex O, Joe, and Alberto)
Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work. (via oh my god, Roman, and xfze)
If you answered “No” to any one of these questions, there’s your problem.


If you answered “Yes” for each of these questions and you still have an invalid product ID, then you have a problem I haven’t seen before. Check out the links in the next section, several of which are Developer Forum posts that were especially helpful in my hunt for debugging invalid product IDs.


5.再使用別人提供的例子代碼測試IAP完成以後,這裡向你介紹一個別人封裝好的類庫:ECPurchase
http://www.cocoachina.com/bbs/read.php?tid-38555.html
類庫在附件中下載。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.