YuheiNakasaka / RNHBFav

HBFavのReactNative版
50 stars 3 forks source link

Webview does not connect to some url #1

Closed YuheiNakasaka closed 7 years ago

YuheiNakasaka commented 7 years ago

This is the bug of react-native.

To avoid this error, please add the patch code to node_modules/react-native/React/Views/RCTWebview.m,

- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
 navigationType:(UIWebViewNavigationType)navigationType
{

  if (![request.URL.scheme isEqual:@"http"] &&
      ![request.URL.scheme isEqual:@"https"] &&
      ![request.URL.scheme isEqual:@"about:blank"]) {
         if ([[UIApplication sharedApplication]canOpenURL:request.URL]) {
             [[UIApplication sharedApplication]openURL:request.URL];
         }
      return NO;
  }

...
YuheiNakasaka commented 7 years ago

これ使うと一応エラー発生しなくなる可能性があるので試す。 https://github.com/CRAlpha/react-native-wkwebview

YuheiNakasaka commented 7 years ago

差し替えたのでもう大丈夫っぽい