Add a custom interface for onShowFileChooser on the Android platform
Environment
Flutter version: any version Plugin version: 6.+
Description
What you'd like to happen:
Firstly, I would like to express my gratitude to the author for their hard work. I downloaded your code and checked the code on the Android platform. It was an amazing amount of work and the quality of the code was second to none. After reading it for a few days, I deeply felt the author's hard work and even wanted to pay for a cup of coffee for you. Although the engineering design is excellent, in order to meet the ever-changing requirements in product design, I have to modify your code and add my own logic. This change is not significant, but I hope you can add it to your library.
The current version will trigger Android native image or video selectors after the<input tag is clicked. I hope you can add a function or other switches so that we can freely choose whether to pull up native or other third-party media selectors. This demand is very common on Chinese Mainland. They are very keen to follow the Wechat interface for development, and of course they have also imitated the media selectors in order to reduce the use cost of users.
Personally, I also hope that you can make changes. In some countries where Android customization is more in-depth, especially in China, Xiaomi, vivo, Oppo, Huawei, and others often tamper with or even destroy the native media selectors of Android. I do not recommend the practice of implementing the<input tag in the code that you are currently fixed in.
Finally, I hope the author can continue to maintain. Chinese Mainland is more enthusiastic about the mixed development model of "fluent/native+H5", so your open source library will continue to shine in the future and benefit more people.
Alternatives you've considered:
Images:
👋 @ditingvh
NOTE: This comment is auto-generated.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
Hi @ditingvh, Did you add it or any workaround ?
Hi,
Intercepting the file picker dialog is crucial on Android devices, where permissions are required to access the camera to upload pictures. This feature would be appreciated indeed since I didn't find any alternative solution other than injecting javascript or callbacks.
cc @arrrrny if you are working on the fork, maybe this can be a nice addition 😄
@simonetavoletta I am happy to review/test and merge a PR if someone makes it. First things first, we needed a package thats maintained swiftly during big changes like we had with Xcode. Many developers including myself depend on it and I stepped in to take responsibility of maintaining it forward.
Any updates?
I also need an interface that asks the user for permission to access photos! The implementation using Android's onShowFileChooser method works perfectly, which is amazing, but I would really appreciate it if you could add this feature as well!
Any updates?