Skip to content

Commit 4c027f3

Browse files
authored
fix(ios): release userAgentLock for IAB compat (#558)
fix #551
1 parent 9e8d35f commit 4c027f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ios/CDVWKWebViewEngine.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,10 @@ - (void)webView:(WKWebView*)webView didStartProvisionalNavigation:(WKNavigation*
670670

671671
- (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation
672672
{
673+
#ifndef __CORDOVA_6_0_0
674+
CDVViewController* vc = (CDVViewController*)self.viewController;
675+
[CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
676+
#endif
673677
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:webView]];
674678
}
675679

@@ -681,6 +685,9 @@ - (void)webView:(WKWebView*)theWebView didFailProvisionalNavigation:(WKNavigatio
681685
- (void)webView:(WKWebView*)theWebView didFailNavigation:(WKNavigation*)navigation withError:(NSError*)error
682686
{
683687
CDVViewController* vc = (CDVViewController*)self.viewController;
688+
#ifndef __CORDOVA_6_0_0
689+
[CDVUserAgentUtil releaseLock:vc.userAgentLockToken];
690+
#endif
684691

685692
NSString* message = [NSString stringWithFormat:@"Failed to load webpage with error: %@", [error localizedDescription]];
686693
NSLog(@"%@", message);

0 commit comments

Comments
 (0)