I am implementing an in app purchase and I am sending the request to apple store through
- (void) requestProductData
{
SKProductsRequest *request= [[SKProductsR
Try to implement also - (void)request:(SKRequest *)request didFailWithError:(NSError *)error
method - may be there're some errors in processing of your requests.
I faced the same problem, but in my case the cause was that I was using Automatic Reference Counting and I forgot to retain the request.
My code was like:
- (void) requestProductData
{
SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:ProductIdentifier]];
request.delegate = self;
[request start];
}
But delegate's productsRequest:didReceiveResponse: never got called.
A fix would be:
@property (strong, nonatomic) SKProductsRequest *request;
- (void) requestProductData
{
self.request= [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:ProductIdentifier]];
self.request.delegate = self;
[self.request start];
// you can nil request property in request:didFailWithError: and requestDidFinish:
}
I've had a similar problem (error: Cannot connect to iTunes Store). After upgrading iTunes Beta to the latest version it started working again.
I had the same problem. I had created a helper class to handle the IAP and check for the products. What I finally found was the instance of the class I created was being released before the response came back, thus the delegate methods never got called because they did not exist anymore.
I solved my problem by retaining the instance of the helper class in the class I called it from using @proprty(strong, nonatomic)...
If you are not using a helper class and coding it into an existing class then the answer above will work by retaining your SKProductRequest.