fix(WKWebView): Add "Frame load interrupted" error handling for OAuth (#147)

This commit is contained in:
José Luis Pereira 2019-01-11 06:01:49 -08:00 committed by Thibault Malbranche
parent c9a777bdfb
commit 6f612242fe

View File

@ -466,6 +466,13 @@ static NSString *const MessageHanderName = @"ReactNative";
return;
}
if ([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102) {
// Error code 102 "Frame load interrupted" is raised by the WKWebView
// when the URL is from an http redirect. This is a common pattern when
// implementing OAuth with a WebView.
return;
}
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
[event addEntriesFromDictionary:@{
@"didFailProvisionalNavigation": @YES,