Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 892
Sridhar Bollam Avatar asked Sep 24 '09 12:09

Sridhar Bollam


People also ask

What does the purchase identifier was invalid mean?

Typically, it is an issue with the developer's production server not being able to be validated by Apple.

What is product ID in app purchase?

A: A product identifier is a string used to uniquely identify every product you wish to sell from your application. The App Store uses it to retrieve information about a product. It is a string identifier that can only contain alphanumeric (A-Z,a-z,0-9), underscore (_), and period (.) characters.

How do I enable in app purchases Xcode?

In the Xcode Project navigator, select the StoreKit configuration file. Choose Editor > Enable Interrupted Purchases.


2 Answers

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 :)

like image 116
Héctor Ramos Avatar answered Oct 13 '22 08:10

Héctor Ramos


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/

like image 36
Troy Brant Avatar answered Oct 13 '22 09:10

Troy Brant