StoreKit - All product ID's are inval…
apple Verified ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
So I've gone in and out of forums looking at different issues.. I followed all of the steps that have been laid out in each example and took the most sensible bits from each post.
so here's the data i'm working with (obviously changed a bit, but still the same idea)
*created test in-app purchasing user*
*settings->store Account IS the test user created*
Bundle ID: com.example.app
Product ID: com.example.app.brv4w (Status: pending developer approval)
App ID: 3X4MPL3.com.example.app
Enable In App Purchase: CHECKED
SKProductsRequest *myProdsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:@"com.example.app.brv4w"]];
myProdsRequest.delegate = self;
[myProdsRequest start];
-(void) productsRequest: (SKProductsRequest *) request didReceiveResponse:(SKProductsResponse *) response {
in here [response.products count] is 0 and [response.invalidProductIdentifiers count] is 1
I can not figure out how to make [response.invalidProductIdentifiers count] 0 and [response.products count] 1. If anyone has any ideas, please let me know..
Message was edited by: Jason Swaby
15 replies
Sign in or join Beachball Help to reply.
- 0
WoodmanTX ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Jason, did you ever figure this out? I see that you did a strikethrough... what is that intended to mean? I am seeing this
exact same problem and would appreciate any help.Thanks...
Scott - 0
WoodmanTX ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
OK, so by shear chance and a solid bruise on my forehead, the answer came to me. You have so pass in the product IDs that you defined as in-app purchase products in iTunes Connect. You do this in the NSSet you are passing. Here is an example of my code:
NSSet *productIDs = [NSSet setWithObjects:@"com.companyname.productname.productOne", @"com.companyname.productname.productTwo", nil];
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:productIDs];
This worked like a charm. Now to the rest of the code to set up the UI and do the rest of the StoreKit testing. I hope this helps you, or someone else.
Scott
Message was edited by: WoodmanTX
- 0
Svaths ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi,
I am facing same problem (getting response.products count is 0 and response.invalidProductIdentifiers count is 1)
I have enabled inApp purchase for one of my paid apps and created a new inApp purchase with
ProductID: com.company.productXYZ.feature123 (Status: pending developer approval)Can you let me know if I have to give this in SKProductsRequest *myProdsRequest.
or
I have to give the app (productXYZ here)'s Product ID.Can you also let me know how I can get Product ID for my app (productXYZ).
Many Thanks,
Svaths - 0
WoodmanTX ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I got mine working by specifying the whole product ID in the query. Here is some sample code:
NSSet *productIDs = [NSSet setWithObjects:@"com.companyname.appname.feature1", @"com.companyname.appname.feature2", @"com.companyname.appname.feature3", @"com.companyname.appname.feature4", @"com.companyname.appname.feature5", nil];
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers:productIDs];
request.delegate = self;
[request start];Let me know if this doesn't get you going...
- 0
fdqps ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi,
I am having similar problems.
In the response I am getting "null".
Bundle ID : no.teknograd.donate
Product ID: no.teknograd.donate.prod1
Product ID: no.teknograd.donate.prod2This is my code:
- (void) requestProductData
{
NSSet *productIDs = [NSSet setWithObjects:@"no.teknograd.donate.prod1", @"no.teknograd.donate.prod2", nil];
SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:productIDs];
request.delegate = self;
NSLog(@"requestProductData");
[request start];
}- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSLog(@"productsRequest");
NSArray *myProduct = response.products;
NSLog(@"Product count: %@", [myProduct count]);
// populate UI
for(int i=0;i<[myProduct count];i++)
{
SKProduct *product = [myProduct objectAtIndex:i];
NSLog(@"Name: %@ - Price: %f",[product localizedTitle],[[product price] doubleValue]);
NSLog(@"Product identifier: %@", [product productIdentifier]);
}
}Thanks in advance!
- 0
WoodmanTX ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
In your productsRequest method, you are missing several square brackets. Here is what your code should look like:
* (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSLog(@"productsRequest");
NSArray *myProduct = response.products;
NSLog(@"Product count: %d", [myProduct count]);
// populate UI
for(int i=0;i<myProduct count;i++)
{
SKProduct *product = [myProduct objectAtIndex:i];
NSLog(@"Name: %@ - Price: %f", [product localizedTitle], [[product price] doubleValue]);
NSLog(@"Product identifier: %@", [product productIdentifier]);
}
}Let me know if that doesn't work.
- 0
fdqps ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi,
Thanks for your help.
But I think it is the forum removing my square brackets as you can see in your post as well.
So I still have the problem.Any more thoughts?
- 0
WoodmanTX ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Sorry, without having your code to debug on this is going to be tough. Getting null does not sound like you are getting zero products returned (I would expect a count of 0, not null, in that case) so it sounds like your app/bundle IDs and products may be set up OK. It sounds more like you are simply missing a step in your code to get those products. I am not sure what else to tell you.
- 0
fdqps ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hi again
In the didReceiveResponse method I am getting something back from Apple it seems.
It added NSLog(@"invalidProductIdentifiers: %@", response.invalidProductIdentifiers); and this gives me:
Response: (
"no.teknograd.donate.prod1",
"no.teknograd.donate.prod2"
)So I am suffering from invalidProductIdentifiers illness.
Is there any demo product ID's I can connect to to see that my code is working? Would make life easier if I could pin doen if the problem was in my code, or in my product setup.
- 0
WoodmanTX ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
That sounds distinctly like a product setup problem. Are you sure the products (the in-app products, that is) have "no.teknograd.donate.prod1", etc., as their product ids? It took a few tries for me to get this right too. For me, the bundle id in my info.plist didn't match the app as I defined it in iTunes Connect. Long story as to why, and I doubt you have the same problem, but my point is that you need to cross-verify everything.
- 0
fdqps ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Thanks WoodmanTX!
I went through everything and saw that the Bundle ID did not match the Info.plist.
Seems you can't change Bundle ID so I needed to rename everything else.Just a minute ago I got back price and name.
Thanks!
- 0
nyu ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hello,
I'm in the same case.
To test "In App Purchase" functionality, I've first created a new test application signed with the provisionning profile of a paid application.
The trouble is that all products available in the "In App Purchase" are considered as invalidProducts.
I checked many times there is no misspelled errors, the checkbox "Cleared for sale" is checked and the Bundle ID provided in iTunes Connect interface is matching with the Bundle ID of the test application.
But when requesting for retrieving "In App Purchase" products informations, all available products aren't valid.
Moreover, I'm never prompted for "In App Purchase test user" login and password and there is no account in "Settings -> Store" menu logged in on the iPhone.
When displaying 'localizedDescription' of NSError class, just before the transaction fails, I have the message : "Connection to iTunes Connect is impossible".If someone thinks to have a solution or an advice, thanks to tell me.
- 0
jmikres ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I had the same problem and it ended up being me not selecting the "cleared for sale" checkbox when I was creating the in-app purchase item in itunes connect. Once I checked it - no more invalid product id.
- 0
supaegal ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hello,
I have the same problem. Anything seems to be correct, but all purchase items are returned as invalid.
I use the same source code as seen several time in this thread.
The bundle Id is correct, provioning profile is correct, product Ids (com.vendor.appname.itemname) are relative to the bundle Id (com.vendor.appname).
Also the trick from jmikres with creating the purchase items with unchecked "cleared for sale" and activating this later doesn't work.I start to get crazy about this.
Does anyone else has an idea? - 0
Mark Moxon ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Here's something else to try.
I also have the same problem - all products being rejected as invalid - but I've found that it's caused by my application's binary being 'Developer rejected'. If I upload a new binary and leave it in review, my In App Purchases suddenly start working; reject the binary again, and the products start getting rejected again.
I spent 3 days going through my code with a fine-tooth comb before stumbling on this. I hope it helps someone.