StoreKit In App Purchase invalid product identifiers

IphoneStorekit

Iphone Problem Overview


I am getting an empty array of product identifiers from SKProductsRequest.

I did the following steps:

  1. Created a In App Purchase Test User account under 'Manage Users' in iTunes Connect

  2. Created some in app purchase products under 'Manage Your In App Purchases'.

  3. Loaded the app onto the iPhone, went to Settings → Store and logged out of the regular store

  4. Set a breakpoint in the (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response callback

All the submitted Product ID's are in the response's invalidProductIdentifiers property. When submitting the request I tried both the Product IDs created during step 2 as well as those IDs prefixed with the Bundle ID.

Thanks in advance,

Raghu

Iphone Solutions


Solution 1 - Iphone

I tried everything suggested in the Apple forums and here, and still couldn't get it to work.

Found the solution:

Your app needs to be transferred by Xcode for the sandbox to be enabled.

Your app needs to be built and installed locally by Xcode, not downloaded from the App Store.

Obvious, right? Well, if you are working with an update to an existing application, the device will still treat it as an App Store-installed app.

So delete the app from your device. Then install the app back onto the device using Build & Run with your device tethered to your Mac. It should work now :)

Solution 2 - Iphone

I've been compiling a list of the reasons product identifiers come back invalid. Here's a checklist of the potential causes:

http://troybrant.net/blog/2010/01/invalid-product-ids/

Solution 3 - Iphone

The contract for paid applications must be in effect in order to receive data about the in app purchases configured.

This worked for me. I had the exact same problem.

Solution 4 - Iphone

I'm one the the victims here. Well, I was. Yesterday, I had the problem and revised a lot of times all the steps. Today, I reviewed all the list from troybrant.

  1. ok my mistake, I forgot to create the proper distribution profile:fixed

  2. uploaded a binary and rejected immediately: they say it works better than no uploading

  3. ok, other fix: removed the 10 digits before my domain name from everywhere in Xcode (XXXXXXXXXX.com.company.app to com.company.app)

Still not working.

  1. Check my device not to be connected with an iTunes account.

  2. Clean build every time and remove app from device sometimes

Still not working.

  1. Finally, when asking for products, I used only the productID, not the whole com.company.app.productID.

AND it worked.

I think sometimes we have more than 1 mistakes, and when you correct all of them, it's hard to know what was exactly the cause of the problem.

Now I'm happy

Solution 5 - Iphone

Our issue was the last bullet point from Apple's FAQ, "Why are my product identifiers being returned in the invalidProductIdentifiers array?":

  • You did not complete all the financial requirements (see the "Contracts, Tax, and Banking Information" section of this document).
  • You did not use an explicit App ID.
  • You did not use the Provisioning Profile associated with your explicit App ID.
  • You did not use the correct product identifier in your code. See Technical Q&A, QA1329, 'In App Purchase Product Identifiers' for more information about product identifiers.
  • You did not clear your In App Purchase products for sale in iTunes Connect.
  • You might have modified your products, but these changes are not yet available to all the App Store servers.
  • If you or App Review rejected your most recent binary in iTunes Connect.

I changed the most recent version (which had been rejected) to "Waiting for Upload" by clicking "Ready to Upload Binary" in iTunes Connect and the problem was resolved after about 10 minutes.

Solution 6 - Iphone

It seems people are getting confused on Product IDs.

You DON'T need to add the whole domain (ex. com.company.product.inappname) for InApp to work.

You MUST use the EXACT Product ID you create on iTunes Connect. In my case, I just created "Product1", used this when SKProductsRequest is called and that's it.

No more pain.

This link has plenty useful information, though is missing this small detail: http://troybrant.net/blog/2010/01/in-app-purchases-a-full-walkthrough/

Solution 7 - Iphone

Did you log out of the AppStore from Settings.app? Only when you log out, you will be prompted for logging in again.

Is In-App purchases enabled for your App ID? App ID with wild card (*) cannot be enabled for In-App Purchases. For your app, you should create a new App ID.

My two cents here: http://blog.mugunthkumar.com/coding/iphone-tutorial-%e2%80%93-in-app-purchases/

Solution 8 - Iphone

My problem was the first issue described here:

https://devforums.apple.com/thread/23344?start=0&tstart=0

"First, you need to make sure your app-id in the Portal is correct."

Solution 9 - Iphone

Is your In App Purchase "Cleared for Sale"? That's the setting that I didn't check first time.

Solution 10 - Iphone

Setting the Product Name to the same name submitted to iTunes Connect solved it for me.

Solution 11 - Iphone

After struggling for a day or so with invalid products being returned, my solution came down to making sure the purchase item was "Developer approved for sale". Even though there was a green mark next to the item saying "cleared for sale", I still needed to upload a screenshot and select approve.

This seems like a backwards and illogical way of doing things considering I'm still testing my app and not yet ready to put it on sale.

Solution 12 - Iphone

I discovered today another thing that can cause this sort of problem. Some times, for strange reasons, the app gets corrupted and all tries to buy something end in error. I solved my problem deleting the app from the device, cleaning the build on Xcode and building it again to the device.

Solution 13 - Iphone

I found that if your application has a different title in another language then you will have this problem unless you set your iPhone language to English. It only happens in development; there doesn't seem to be a problem for production.

Solution 14 - Iphone

I have 15 non-consummable products.

Suddenly, all 15 of them started to appear as 'invalid' in one of my devices (iPod Touch 4G), but valid in the other (iPhone 4S); very weird indeed.

I deleted/reinstalled and now it works OK.

Someone said you must launch from Xcode, but this is not necessarily true. I have many beta testers with AdHoc builds and Test User accounts, and most of the time they seem to be able to purchase OK.

That said, the whole Sandbox Environment is always shaky and has plenty of "down time". Sometimes waiting is the answer.

Solution 15 - Iphone

Besides everything posted in this topic, I just installed the right debug provision profile, deleted the application from my iPhone, restarted my device and bang, got the product info.

I tried this after getting the product info through the simulator (with the latest Xcode now it is possible). I was about to upload the binary and then reject it, but then I tried the above and got it. Hope it helps!

Solution 16 - Iphone

Make sure your "Product Name" in xcode is the same as the app submitted to iTunes Connect.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSridhar BollamView Question on Stackoverflow
Solution 1 - IphoneHéctor RamosView Answer on Stackoverflow
Solution 2 - IphoneTroy BrantView Answer on Stackoverflow
Solution 3 - Iphoneuser247503View Answer on Stackoverflow
Solution 4 - IphoneLRMView Answer on Stackoverflow
Solution 5 - IphonePhil CalvinView Answer on Stackoverflow
Solution 6 - IphonecolnaghiView Answer on Stackoverflow
Solution 7 - IphoneMugunthView Answer on Stackoverflow
Solution 8 - IphonemorgancodesView Answer on Stackoverflow
Solution 9 - IphoneStephen DarlingtonView Answer on Stackoverflow
Solution 10 - IphoneaegzorzView Answer on Stackoverflow
Solution 11 - IphonejumponadoughnutView Answer on Stackoverflow
Solution 12 - IphoneDuckView Answer on Stackoverflow
Solution 13 - IphoneSjors ProvoostView Answer on Stackoverflow
Solution 14 - IphoneNicolas MiariView Answer on Stackoverflow
Solution 15 - IphoneWolfView Answer on Stackoverflow
Solution 16 - IphoneTracy PlattView Answer on Stackoverflow