views:

3309

answers:

12

I'm trying to test the in App purchase within the sandbox environment.

In order to test the code I

a) created a In App Purchase Test User account under 'Manage Users' in iTunes Connect

b) created some in app purchase products under 'Manage Your In App Purchases'. I used numeric values and alpha-numeric values for the Product ID's.

c) Loaded the app onto the iPhone, went to Settings->Store and logged out of the regular store and into the under a) created test account

d) set a breakpoint in the (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response callback

All the submitted Product ID's are in the response.invalidProductIdentifiers category. When submitting the request I use either the Product ID's used under b) directly or I tried to prefix them with the Bundle ID:

NSString *id2 = @"com.super.duper.8";

NSSet *productList = [NSSet setWithObjects:id2, @"8", nil];

SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:productList];

Am I missing something obvious? Any help is appreciated.

Achim

A: 

This is where you are going wrong, you need this in your code:

NSSet *productList = [NSSet setWithObjects:product id]

You can get this product id from iTunes connect.

And you need to make sure that you have created a test user, and have signed out of your original iTunes account. Please see do not sign in with test user account, regardless of what apple documentation says, just use it when a pop up appears.

Vibhor Goyal
A: 

Hi,

I am facing similar problem.

Can you please let me know how to get this product id from itunes connect.

Many Thanks, Svaths

Svaths
This isn't an answer. -1.
unforgiven3
A: 

Hi Achim,

Did you solve your problem ?

I went with same procedure and having same problem.

Let me know if you resolved your issue that might be very helpful to me.

Thanks In advance

Raghu

Sridhar
+2  A: 

We ended up creating a new provisioning profile, there was a line somewhere (can't recall where, not in the docs for in app purchase) that stated that you have to enable in app purchase in the provisioning profile. We couldn't do that with our existing profile, so we created a new one and then we could enable it.

Achim
A: 

What's that @"8" for? your product is named as com.super.duper.8 right?

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

Mugunth Kumar
A: 

It takes the store some time to make the products available to all server (see documentation). So you might experience a delay between creating a product in iTunes Connect and seeing that product id as a valid one when testing on device. For me it took around 12 hours till my products showed up.

sliver
+2  A: 

For anyone else that has these issues, I highly recommend reading this thread on the Apple Forum.

William Denniss
+2  A: 

I spent two days struggling with all my productsRequest (for AppID) ended up in response.invalidProductIdentifiers list, instead of in response.products list. Apple definitely did an F grade job in dealing with their storekit. It is confusing, intertwined and complex.

I did finally resolved it. One very important lesson I learned as indicated by few in the forums: It may take many hours for what you entered on the itunesconnect.apple.com to take affect.

There are two parts: application name and AppID in your xcode and what you entered in itunesconnection, they have to match exactly (case sensitive). If you registered or modified your in-App AppleID (I also completed all my contracts and bank information as suggested by some that the purchase actions won't work without getting this part done), you may as well go to bed before testing it again because it really takes hours in my case to take affect. I was so frustrated battling with this issue before my 9 year old dragged me for bed time story then surprised to find the issue disappeared when I woke up.

I found the suggestions by Eddy71 in http://www.iphonedevsdk.com/forum/iphone-sdk-development/21035-problems-creating-test-user-app-purchase.html really helpful. Before resolving it I did everything I possibly could do in Eddy's check list and still got zero products, one of my fears was that whether without uploading the binary code to complete the application registration in itunesconnect was ok (no need to go live as taught in http://blog.mugunthkumar.com/coding/iphone-tutorial-%E2%80%93-in-app-purchases/). It is indeed ok. Make sure the "cleared for sale" is check and in the icon is green (you need an extra step to approve it after filling out the form). The other fear was that whether I can use developer provisional (not distribution provisional) in debug mode, it is also indeed ok. I hope this may help some of you. Good luck and have faith. It will work eventually.

Wayne Lo
+2  A: 

If you are still getting invalid product ids, I've been accumulating a checklist of all of the various causes:

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

Troy Brant
A: 

A note for others: do not use an NSMutableSet for the product IDs. It has to be an NSSet!

Jeremy
A: 

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.

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

Delete it, then transfer it again. It should work now :)

Hector Ramos
A: 

There is also a long delay after filling out the tax details. My boss did it yesterday, and today it is simply working.