From 70fe56ee058cc231c3e96ed934bf47ec39bc5635 Mon Sep 17 00:00:00 2001 From: Borui Wang Date: Thu, 14 Sep 2017 13:59:37 -0700 Subject: [PATCH] Add handler for request failure Without this, some webview based app can get stuck. --- IAPHelper/IAPHelper.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/IAPHelper/IAPHelper.m b/IAPHelper/IAPHelper.m index fe15148..3a9cb3d 100755 --- a/IAPHelper/IAPHelper.m +++ b/IAPHelper/IAPHelper.m @@ -353,6 +353,15 @@ -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)erro } +- (void)request:(SKRequest *)request didFailWithError:(NSError *)error +{ + if (request == self.request) + { + _requestProductsBlock(nil, nil); + } +} + + -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [self.receiptRequestData setLength:0]; }