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

Not getting errors when requesting products #41

Open dvkch opened 7 years ago

dvkch commented 7 years ago

Hi,

I just noticed when -requestProductsWithCompletion: doesn't report errors happening in the request. Adding a NSError * parameter to the block type and the following method to IAPHelper.m seems to fix the issue for me :

- (void)request:(SKRequest *)request didFailWithError:(NSError *)error
{
    self.request = nil;

    if(_requestProductsBlock) {
        _requestProductsBlock (request,nil, error);
    }
}

Do you confirm it is the right approach and if so would it be possible to add it to a future release ?

Thanks a lot for considering,

Stan

dvkch commented 7 years ago

Noticed it was reported as #21 . I can reproduce it on iOS 8.4.1 and iOS 10.0.2 just by calling this single method and having no internet connectivity (iPhone on Airplane mode or iPad with Wi-Fi off)