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)
My App ID is generated (with no wildcards) - inApp purchase is enabled
My IAP(In-App Purchase) is added in "Manage your in-app purchases" and cleared for sale.
My IAP is added 24 hours ago ( maybe couple of hours more) and is in "Waiting For Review" state
My App itself is developer rejected > and it is state "ready to upload", in-app purchase is added to the App.
My phone is not jailbroken (at least not anymore, didn't worked either way)
I am working with a 3GS, 5.1 iOS.
My current provisioning profile is a "Developer Profile" not a "Distribution Profile". "Distribution Profile" is used only while uploading the Application Binary.
I am building for iOS 5.0 and build configuration is set to Debug.
I deleted the app like 100 times now, literally.
All details are set in iTunes Connect, including bank details.
I have created a test user, and I logged in from "Settings > Store" on my device.
My SKProductRequest
:
SKProductsRequest *productRequest = [[SKProductsRequest alloc]initWithProductIdentifiers:[NSSet setWithObject:@"com.my_site.my_app.my_product"]];
Any other information can be supplied.
In my case the problem was that I had previously created "StoreKit Configuration file" and then made change in Product Scheme:
Go to Product > Scheme > Edit Scheme and in Run/Debug tab under Options I chose StoreKit configuration file.
Apparently this config was used instead of my App Store Connect IAP. So, the solution was to uncheck that option. You don't have to delete StoreKit Config file if you still need it for some reason.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With