Skip to content

Commit

Permalink
Fixes #77 (Fix crash on didFailNavigation)
Browse files Browse the repository at this point in the history
  • Loading branch information
charafau committed Nov 15, 2018
1 parent ad490a7 commit 9b40307
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ios/Classes/FlutterWebviewPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,7 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat
}

- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error {
id data = [FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", error.code]
message:error.localizedDescription
details:error.localizedFailureReason];
[channel invokeMethod:@"onError" arguments:data];
[channel invokeMethod:@"onError" arguments:@{@"code": [NSString stringWithFormat:@"%ld", error.code], @"error": error.localizedDescription}];
}

- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler {
Expand All @@ -292,4 +289,4 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
}
}

@end
@end

0 comments on commit 9b40307

Please sign in to comment.