11

It has been a long night chasing the problem within my in-app purchase trials yet I can not seem to solve this issue.My product identifier keeps returning as "invalid product identifier". Hopefully someone will point it out; (With current provisioning profile and appId I got push notifications working)

  1. My App ID is generated (with no wildcards) - inApp purchase is enabled

  2. My IAP(In-App Purchase) is added in "Manage your in-app purchases" and cleared for sale.

  3. My IAP is added 24 hours ago ( maybe couple of hours more) and is in "Waiting For Review" state

  4. My App itself is developer rejected > and it is state "ready to upload", in-app purchase is added to the App.

  5. My phone is not jailbroken (at least not anymore, didn't worked either way)

  6. I am working with a 3GS, 5.1 iOS.

  7. My current provisioning profile is a "Developer Profile" not a "Distribution Profile". "Distribution Profile" is used only while uploading the Application Binary.

  8. I am building for iOS 5.0 and build configuration is set to Debug.

  9. I deleted the app like 100 times now, literally.

  10. All details are set in iTunes Connect, including bank details.

  11. I have created a test user, and I logged in from "Settings > Store" on my device.

  12. My SKProductRequest:

    SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]];
    

Any other information can be supplied.

pkamb
  • 26,648
  • 20
  • 124
  • 157
Bartu
  • 2,050
  • 1
  • 24
  • 49

6 Answers6

7

I don't know how, and don't know will it remain valid. But here is the interesting solution which let me solve my problem.

According to the documentation, SKProductRequest should be;

SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]];

Your product request should be like this;

com.my_site.my_app.my_product

but in my situation I just sent my product id, just like this and it WORKED;

SOLUTION #1

SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"my_product"]];

While digging in, I found that for some people this notation also worked;

SOLUTION #2

SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObjects:@"com.my_site.my_app","my_product",nil]];

There was nothing wrong with my setup, and the above listed things should be supplied, if anyone having problems with invalid product identifiers, I recommend them to visit Troy Brant's "Cause of Invalid Product ID's List", here . Also you can find his detailed walkthrough about implemeting and setting up IAP, here.

If you get desperate, I strongly recommend you to try both solutions, and they can save you from hours of frustration.

Bartu
  • 2,050
  • 1
  • 24
  • 49
  • 1
    I've been trying it for some hours, and I was getting mad. For some reason, you solution number 1 have worked. Thanks! – user1573607 Feb 03 '14 at 13:50
  • Thank you thank you, I just sent product id without bundle id prefixed and it worked! – marchinram Jun 18 '14 at 06:23
  • @Bartu: We are experiencing a very weird issue on the App Store under iOS7, see http://stackoverflow.com/questions/28849100/storekit-returns-invalid-product-identifiers-only-on-the-real-app-store-only and I would be willing to try this. I was wondering what the identifier you set up in itunes connect was in your case? Was it com.my_site.my_app or just my_product? – Johannes Rudolph Mar 07 '15 at 21:23
  • Spent 2 days on this problem but could find any solution. Literally tried everything like hell. I even tried using App IDs but not names and the solution number 1 with the app names worked.. Thanks a lot man.. +1 on both question and answer.. – Ahsan Ebrahim Jun 12 '15 at 07:37
4

Please make sure about below.

Please remove Existing application from Device and Install fresh build from Xcode.

Have you enabled In-App Purchases for your App ID?

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 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?

Is your device jailbroken? If so, you need to revert the jailbreak for IAP to work.

If you answered No to any one of these questions, there’s your problem.

Please refer Reference

Hitesh Surani
  • 9,976
  • 5
  • 37
  • 55
  • #3 did the trick for me – this seems like a pretty common pitfall if you're using multiple build targets to flexibly compile an app for different API environments. – Arvoreniad Aug 08 '20 at 16:51
  • For me, I had to upload an item screenshot (dummy one is okay until app review) at the last section to finally make things work. – user482594 Feb 09 '21 at 16:46
3

My paid applications agreement wasn't valid in iTunes Connect. As soon as I agreed to the new one, it fixed the problem.

0

You are using the latest provision profile right(which is downloaded after setting up in-app purchase).

Chandan Shetty SP
  • 4,995
  • 6
  • 39
  • 61
  • True. I tried using both the new provisioning profile after I created in-app purchase and the one that I created beforehand. None works. – Bartu Jul 09 '12 at 10:20
0

Spends a couple of days at this. Here is what was missing from mine:

  • Make sure the BundleID in iTunes Connect matches that in your Xcode project.
pkamb
  • 26,648
  • 20
  • 124
  • 157
gordoneliel
  • 86
  • 1
  • 7
0

Things ended up working for me:

  • I use Xcode automatic profiles and I got a bit confused on the app store connect webpage with the profile. I made sure ids matched on Xcode and on the webpage.
  • I just needed the product id, not the full com.company.app.product
  • took me like 2 hours to have things work, so maybe some refresh time on Apple's servers
Thomas
  • 6,610
  • 7
  • 40
  • 79