gree / unity-webview

zlib License
2.25k stars 688 forks source link

Can't execute on iOS 8.1 #266

Open zouloux opened 6 years ago

zouloux commented 6 years ago

Hello and thanks for this script, this is super useful ! We are trying it to know if it fits our requirements, and it seems really lite, loving the approach 👍

No problem running it inside iOS Simulator or real device with iOS 11.

But we have an iPad Air with iOS 8.1.2, and this error is thrown at runtime :

-[WKWebView loadFileURL:allowingReadAccessToURL:]: unrecognized selector sent to instance 0x154faaa0

I think this is a unity-webview issue but maybe i'm wrong.

Any idea ? Many thanks !

KojiNakamaru commented 6 years ago

Ah, sorry loadFileURL:allowingReadAccessToURL: is introduced in iOS9. If you need to access local html files, it might be better to switch UIWebView/WKWebView by enableWKWebView: https://github.com/gree/unity-webview/blob/7c61559e3ad8e01d858c8658840d38d193efccd3/plugins/WebViewObject.cs#L253 depending on the iOS version detected by: https://docs.unity3d.com/ScriptReference/SystemInfo-operatingSystem.html

zouloux commented 6 years ago

Thanks for the quick answer :) Will try that and close the issue when tested.