I am trying to test the Application Shopping app on my iPhone and run into a problem when the product identifiers I request ultimately return to me as invalid product identifiers in the didRecieveResponse method.
I have:
- A product has been created in the store related to this application. It associates the identifier with everything else. It has been cleaned for sale and approved by the developer.
- Make sure that in my new settings profile there is access to in-app purchases and it has the full name of the application: "com.domain.appname"
- Make sure that this is the provisioning profile that is used to sign the application on my iPhone.
- Ensure that "com.domain.appname" is the application identifier used to create the provisioning profile.
- Make sure that "com.domain.appname" is used in my plist file as the package identifier.
Everything seems to be in place, however, I still get that my products come back to me as invalid identifiers.
This is the code I'm using:
- (void)requestProductData { SKProductRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObject: @"com.domain.appname.productid"]]; request.delegate = self; [request start]; } - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { NSArray *myProducts = response.products; NSArray *myInvalidProducts = response.invalidProductIdentifiers; for(int i = 1; i < myInvalidProducts.count; ++i) { std::cout <<"invalid product id = " << [[myInvalidProducts objectAtIndex:i] UTF8String] << std::endl; } for(int i = 0; i < myProducts.count; ++i) { SKProduct * myProduct = [myProducts objectAtIndex:i]; std::cout << "Product Info:" << std::endl; std::cout << "\tlocalizedTitle = " << [[myProduct localizedTitle] UTF8String] << std::endl; std::cout << "\tlocalizedDescription = " << [[myProduct localizedDescription] UTF8String] << std::endl; std::cout << "\tproductIdentifier = " << [[myProduct productIdentifier] UTF8String] << std::endl; std::cout << "\tprice = " << [[myProduct price] doubleValue] << std::endl; std::cout << "\tpriceLocale = " << [myProduct priceLocale] << std::endl; } [request autorelease]; }
All my product identifiers appear in invalid printouts, and none of them appear in printouts of "Product Information:".
Any suggestions would be greatly appreciated ...
PS Yes, it is built as Objective-c / C ++.
source share