Browse Source

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
hank121314 4 years ago
parent
commit
c366fdf2e7
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      ios/RNCWebView.m

+ 1
- 1
ios/RNCWebView.m View File

@@ -438,7 +438,7 @@ static NSURLCredential* clientAuthenticationCredential;
438 438
         [_webView loadRequest:request];
439 439
     }
440 440
     else {
441
-        NSURL* readAccessUrl = _allowingReadAccessToURL ? [NSURL URLWithString:_allowingReadAccessToURL] : request.URL;
441
+        NSURL* readAccessUrl = _allowingReadAccessToURL ? [RCTConvert NSURL:_allowingReadAccessToURL] : request.URL;
442 442
         [_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
443 443
     }
444 444
 }