gree / unity-webview

zlib License
2.29k stars 691 forks source link

iOS WebView blank. #380

Open MMallea opened 5 years ago

MMallea commented 5 years ago

I recently implemented web view on my project and it works well on Android, but only shows white on iOS. I've tried changing the graphics API to OpenGLES3, but without any change. Any help would be appreciated.

KojiNakamaru commented 5 years ago

The implementation for iOS real devices utilizes native WKWebView/UIWebView and can run regardless of which graphics api you select. Could you please try to run the sample app? If it works okay, your html/javascript content might have any issue.

MMallea commented 5 years ago

Thank you. It ended up working, but we aren't sure why. We tested the sample and it worked. We then tested with the link that wasn't working and it worked. Finally, we tested the implementation on the app again and it worked (despite no changes to the code). Maybe it was a loading issue?

MMallea commented 5 years ago

@KojiNakamaru After a little bit of testing, it seems that the issue is related to loading the webpage. There is a chance that the webpage will not appear at all and just appear blank. This also occurs on Android, but a lot less.

KojiNakamaru commented 5 years ago

Though at least iOS12 seems not to be affected, I've modified WebView.mm to set configuration.websiteDataStore as https://stackoverflow.com/questions/48622032/ios-wkwebview-does-not-support-local-storage/51736967#51736967, for example, discusses it. I've updated binaries so could you please try the latest.