Question about file importing on web view
Nobody has claimed this yet.
- Dominant language
- Objective-C++
- Stars
- 2.7k
- Forks
- 734
- Avg merge
- 11h 39m
- Merged PRs (30d)
- 1
Description
Hello, and thanks for the plugin.
I am currently trying to implement a file upload feature for a remotely hosted website inside the WebView.
I based my implementation on the example branch for #1179, which works fine but explicitly requires runtime permissions for Camera, Microphone, and Audio. For my specific project use case, I do not want to request camera or microphone permissions from the user. I only need standard file/gallery access to allow uploading images and/or videos.
However, whenever I remove the camera/microphone permissions from the AndroidManifest.xml and set webViewObject.SetCameraAccess(false), clicking the file input button inside the remote website does absolutely nothing, the Android file chooser window fails to appear.
Is there any workaround to allow standard uploads from remote websites without declaring or requesting Camera and Microphone permissions?
Thank you in advance.
Regarding code, the SampleWebView is the same present on the example branch. And the following is my manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:requestLegacyExternalStorage="true"
android:allowBackup="false"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="true">
<!--Used when Application Entry is set to Activity, otherwise remove this activity block-->
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<!--Used when Application Entry is set to GameActivity, otherwise remove this activity block-->
<activity android:name="com.unity3d.player.UnityPlayerGameActivity"
android:theme="@style/BaseUnityGameActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.app.lib_name" android:value="game" />
</activity>
</application>
</manifest>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the example branch for #1179 and the SampleWebView implementation, then reproduce the remote site's file-input behavior with SetCameraAccess(false) and the permissions shown in the manifest. Determine whether standard image/video uploads can open the Android chooser without camera or microphone permissions; the issue is done when the supported configuration and required changes are documented or the behavior is fixed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, unity
- Domain
- mobile, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100