StoreKit In App Purchase invalid product identifiers [duplicate]

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


Solution 1:

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:

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:

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:

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