Skip to content

Commit a8ffb95

Browse files
committed
Fixes #77 (Fix crash on didFailNavigation)
1 parent bd4d485 commit a8ffb95

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ios/Classes/FlutterWebviewPlugin.m

+2-5
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,7 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat
270270
}
271271

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

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

295-
@end
292+
@end

0 commit comments

Comments
 (0)