Open Andrew-Tan opened 7 years ago
I'm having the same problem +1
+1
In the debug mode, it works fine, but not in release. I find that in debug mode, webView load js files from http://localhost:8081, in release mode, webview can only load js files from bundle resources. But, even I add the js files to the 'Copy Bundle Resources', it still not works.
<html>...</html>
`Just transfer the html to vewView
<WebViewBridge ref="webviewbridge" source={{html:html}}>
</WebViewBridge>
Change the code in RCTWebViewBridge.m
if (html) {
NSURL *baseURL = [RCTConvert NSURL:source[@"baseUrl"]];
[_webView loadHTMLString:html baseURL:baseURL];
return;
}
To
if (html) {
NSURL *url = [NSURL fileURLWithPath: [[NSBundle mainBundle] resourcePath] isDirectory: YES];
[_webView loadHTMLString:html baseURL:url];
return;
}
Then, it works fines now.
Hi,
I am intended to use webview bridge to display a local html page. When I try injecting the script through webview bridge, everything works. However, then I try putting the same script directly into the html page through tag, it doesn't seems to work.
Any hints? Thanks