From c366fdf2e76b263722b48733dfaea2dfeb276b5b Mon Sep 17 00:00:00 2001 From: hank121314 Date: Thu, 5 Sep 2019 21:13:33 +0800 Subject: [PATCH] fix(iOS): use RCTConvert to convert allowingReadAccessToURL. (#845) * fix(ios):use RCTConvert to convert url instead of using URLWithStringg * fix(iOS):remove stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding, because it's deprecated in iOS 9 --- ios/RNCWebView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/RNCWebView.m b/ios/RNCWebView.m index 98d23c1..ab81975 100644 --- a/ios/RNCWebView.m +++ b/ios/RNCWebView.m @@ -438,7 +438,7 @@ static NSURLCredential* clientAuthenticationCredential; [_webView loadRequest:request]; } else { - NSURL* readAccessUrl = _allowingReadAccessToURL ? [NSURL URLWithString:_allowingReadAccessToURL] : request.URL; + NSURL* readAccessUrl = _allowingReadAccessToURL ? [RCTConvert NSURL:_allowingReadAccessToURL] : request.URL; [_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl]; } }