android: request camera permission for inputs #2033
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR tried to implement requesting user permissions on Android when the input field contains
capture
param. Requesting camera permission on app startup is not the best UX. This PR tries to delay the permission request until the user actually requires this action.Testing and Review Notes
You can pass this URL with into the example project WebView: https://12t031.csb.app/
One input is with
capture
while the other one is regular.Clicking on
capture
input should on Android request permissions. When the request is either accepted or denied then the file picker is resumed. When user accepts the permission the file picker contains the option to take a picture with camera.To Do
I don't regularly touch Java code and there is high chance this is not the best approach. However, this feature is important for me. Let me know if there are any changes need so it could be possibly merged and published.
Thank you!