Answer the question
In order to leave comments, you need to log in
StreamingAssetsPath unity iOS?
Hello.
I need to open a local html file in webview
Links like
file:///path/file.html
It works well on Android and iOS Simulator but doesn't work on iOS build (doesn't load html).
Local link generator
public string generatePath(string path)
{
#if (UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_IOS) && !UNITY_EDITOR_WIN
return Path.Combine("file://" + Application.streamingAssetsPath, path);
#elif UNITY_ANDROID
return Path.Combine("file:///android_asset/", path);
#else
return Path.Combine("file://" + Application.streamingAssetsPath, path);
#endif
}
webViewObject.LoadURL(generatePath("local_www/History/History_XIX.html"));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question