S
S
Sergei Chamkin2020-09-10 02:26:41
Unity
Sergei Chamkin, 2020-09-10 02:26:41

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
    }


usage
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 question

Ask a Question

731 491 924 answers to any question