Invalid Product IDs

来源:互联网 发布:淘宝女内衣 编辑:程序博客网 时间:2024/06/04 17:52

Do you have an invalid product ID that won’t go away? Good thing the StoreKit API provides error codes and detailed error information explaining why the ID is invalid.

Oh, what’s that? There are no error codes or error details of any kind when you have an invalid product ID, you say? Bah, silly me.

To save you the pain of exhaustively searching the web for the cause of your error, here is a checklist of everything I have stumbled across that can cause an invalid product ID. Make sure you can answer “Yes” to each of these questions:

  • 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.

Resources for Debugging an Invalid Product

Here are the docs and resources I used to debug invalid product IDs:

  • Official In App Purchase Programming Guide
    • http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Introduction/Introduction.html
  • Official iTunes Connect Developer Guide (In App Purchases starting on page 52)
    • https://itunesconnect.apple.com/docs/iTunesConnect_DeveloperGuide.pdf
  • Developer Forums – Best thread on debugging in-app purchases
    • https://devforums.apple.com/thread/23344?start=0&tstart=0
  • Developer Forums – Invalid product ID with solution
    • https://devforums.apple.com/message/146017
  • Developer Forums – Invalid product ID with solution
    • https://devforums.apple.com/message/136985
  • Developer Forums – Invalid product ID with solution
    • https://devforums.apple.com/message/147790
  • Developer Forums – “in app purchase invalid” search results
    • https://devforums.apple.com/search.jspa?q=in+app+purchase+invalid&resultTypes=MESSAGE&peopleEnabled=true&dateRange=last90days&username=&numResults=50
  • Apple StoreKit support forums – Invalid product ID with several solutions
    • http://discussions.apple.com/thread.jspa?messageID=10344191

If your solution for invalid product IDs wasn’t mentioned in the checklist above, please leave a comment detailing how you fixed the problem so I can keep the checklist up to date.

1.在生成商品的时候,最后一步,Screenshot for Review,这个我一开始没有添加,导致一直商品无效。

2.还有一个就是银行的信息,其实在创建商品的时候,最顶部是有提示的,需要提供bank info.

以上两条信息希望可以帮助还没有找到问题的朋友。



在解决这个问题的同时,验证出,原先的证书是通配符,现在用不是通配符去更新升级,是没有问题的。

原创粉丝点击