Closed zhanglubin12345 closed 8 months ago
The plugin should work without any modification If you correctly follow the instruction described in https://github.com/gree/unity-webview/tree/1235da5a7461ccc83dd1274caba45c203b9aa37d#file-input-field .
@KojiNakamaru I've certainly tried all of these, but none of them worked properly. Therefore, I modified the plugin's code to make it work correctly.
Please provide your environment information such as Unity version, Android version, device name, etc.
I put an adjusted sample app under https://github.com/gree/unity-webview/tree/example-for-1022/sample, which can be directly built with Unity 2020.3.48f1. This works well at least on OSCAL Pad8 (Android 11) and Pixel 6a (Android 13).
@KojiNakamaru I have tested with both Unity 2020.3.40f1 and Unity 2022.3.14f1. My test device runs on Android 11. However, other players on our team are also unable to use this upload feature, so it seems to be a common issue.
Typically, when facing this issue, it's because the permissions are not set in the AndroidManifest.xml. However, even after setting the AndroidManifest.xml, unity-webview still doesn't work. Therefore, I tried developing a new AAR file myself, which simply displays a WebView, and indeed, the AAR file I developed works.
Next, I tried another commonly used plugin, UniWebView, and found that UniWebView is also working correctly. This confirms that unity-webview has an issue. I tested the sample you provided in the master branch, but it also doesn't work.
Please try https://github.com/gree/unity-webview/tree/example-for-1022/sample at first, as is. If it doesn't work then we can investigate the issue further based on the same code.
FYI, the former code of this plugin performed almost the same thing you wrote. The current code was introduced because permission requests didn't work well for some cases.
@KojiNakamaru Yes, it works
I have tried the sample from the master branch, and it doesn't work. What are the differences between this branch and the master branch?
The changes from the master branch can be found at https://github.com/gree/unity-webview/compare/1235da5...06d8c41 .
I don't know why importing the latest version of unity-webview.unitypackage doesn't work, but it runs successfully with the modifications I mentioned above. Thank you for your response. This has taken up too much of my time, so I will have to use the version with my own modifications for now.
I tried switching to UniWebView and found it functional. After making the following adjustments to the code, input file is also working now.