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
- Official iTunes Connect Developer Guide (In App Purchases starting on page 52)
- Developer Forums – Best thread on debugging in-app purchases
- Developer Forums – Invalid product ID with solution
- Developer Forums – Invalid product ID with solution
- Developer Forums – Invalid product ID with solution
- Developer Forums – “in app purchase invalid” search results
- Apple StoreKit support forums – Invalid product ID with several solutions
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.