I have one big problem with testing an IAP purchase.
There are the following steps that I have taken:
- Create application id ( com.domainname.appname )
- Create a Provisioning Development profile with application ID ( com.domainname.appname )
- Create an application in iTunes Connect (package identifier com.domainname.appname )
- IAP Management Create non-consumable products with product ID com.testitem1, com.testitem2, com.testitem3 (readiness to send status for each product)
Configure Xcode Project Settings
Package ID: com.domainname.appname
Code Sign Identification: A Provisioning Profile for Development, which I did in step
Deployment Goal: 4.0
Device
iPod Touch 4gen iOS 5.1.1
Enter the source code
My class support SKProductsRequestDelegate
in - viewDidLoadcallback method I wrote these lines:
if ([SKPaymentQueue canMakePayments])
{
NSLog(@"YES, I CAN MAKE PAYMENTS");
}
else
{
NSLog(@"NO, I CAN NOT MAKE PAYMENTS");
}
At this point, everything is in order. I can make payments.
Then I try to create a query for my products:
SKProductsRequest *request = [[SKProductsRequest alloc] initWithProductIdentifiers: [NSSet setWithObjects:@"com.testitem1", @"com.testitem2", @"com.testitem3", nil]];
request.delegate = self;
[request start];
At this point, everything is fine, and at the next stage, my request object calls the callback method below:
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{
NSArray *myProduct = response.products;
NSLog(@"%@", myProduct);
}
But there are no products in the answer, and I do not understand why.
I already have this problem before (I just reset my device and everything worked fine), but in this case I can not understand what is wrong.