saturngod / IAPHelper

No more maintenance for this repo. Please use the https://github.com/bizz84/SwiftyStoreKit
MIT License
1.55k stars 280 forks source link

-requestProductsWithCompletion: block not called when request error (simulator only) #13

Closed hlung closed 10 years ago

hlung commented 10 years ago

The block of this method is not called on request error.

[[IAPShare sharedHelper].iap requestProductsWithCompletion:^(SKProductsRequest* request,SKProductsResponse* response)
     {
        // never called
     }];

Looks like this happens in simulator only. May be we should add the SKRequest delegate method to print a log message that this won't work on simulator instead of going silent.

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
    NSLog(@"Warning: the completion block of -requestProductsWithCompletion method won't be called in iOS simulator. Please test on device.");
}
brandonscript commented 10 years ago

This is because as of iOS 7, StoreKit no longer functions on the simulator. See this StackOverflow post and the update to the accepted answer.

saturngod commented 10 years ago

Thank @r3mus