-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load images from persistentdatapath #224
Comments
diff --git a/sample/Assets/Scripts/SampleWebView.cs b/sample/Assets/Scripts/SampleWebView.cs
index 9ec7973..f8ab5dc 100644
--- a/sample/Assets/Scripts/SampleWebView.cs
+++ b/sample/Assets/Scripts/SampleWebView.cs
@@ -104,7 +104,10 @@ public class SampleWebView : MonoBehaviour
}
System.IO.File.WriteAllBytes(dst, result);
if (ext == ".html") {
- webViewObject.LoadURL("file://" + dst.Replace(" ", "%20"));
+ //webViewObject.LoadURL("file://" + dst.Replace(" ", "%20"));
+ webViewObject.LoadHTML(
+ System.Text.Encoding.UTF8.GetString(result),
+ "file://" + Application.persistentDataPath.Replace(" ", "%20") + "/");
break;
}
} However, WKWebView forbits |
Hi, I just stumbled upon this. Does it mean that this package won't work with file:// URLs embedded in a web page as well, unless you switch to UIWebView? I am asking because WKWebView is required by Apple nowadays. There is a flag to tell WKWebView that it may allow this: Is this implemented in this package? Also wondering how the situation is for Android 10. (We are currently using UniWebView and have problems with exact this. We need access to a local file that is actually a screen shot of the native Augmented Reality camera. It seems as if this worked in UniWebView before, but now is broken. I was wondering if we could use your package instead.) |
This plugin just utilizes native Android WebView and/or iOS WKWebView/UIWebView components. The However, as described above, WKWebView (since iOS9) allows to load local files if you use Please note the sample app first writes these files into unity-webview/sample/Assets/Scripts/SampleWebView.cs Lines 119 to 148 in ac10622
Android 10 seems to have many troubles about WebView, but these should be reduced by updating Android System WebView from Google Play. |
Hi, i load my html from an sqlite database on iOS, and all the images relative to this HTML in downloaded on the device in the persistentdatapath.
Using
The html il loaded correctly, but i can't see any images, are a there a workaround for this?
thanks
The text was updated successfully, but these errors were encountered: