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 5 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
         [_webView loadRequest:request];
438
         [_webView loadRequest:request];
439
     }
439
     }
440
     else {
440
     else {
441
-        NSURL* readAccessUrl = _allowingReadAccessToURL ? [NSURL URLWithString:_allowingReadAccessToURL] : request.URL;
441
+        NSURL* readAccessUrl = _allowingReadAccessToURL ? [RCTConvert NSURL:_allowingReadAccessToURL] : request.URL;
442
         [_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
442
         [_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
443
     }
443
     }
444
 }
444
 }