-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(GH-706): (android) Allow permissions requests #968
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your solution is working fine for microphone access 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spent numerous hours trying to find a solution for this. I can confirm the above change makes it work! Would vote to get it merged asap
plase confirm this fix. |
Does this change assumes that you have the proper permissions declared in the |
Yes, the permissions must be declared in AndroidManifest.xml, additionally, permissions must be granted as with this change there is no OS permission popup if permissions have not been allowed. |
Ok, so to be clear we have the following use cases:
Case 1
Because the Case 2
Because the Case 3
The Do these case results correctly represent the behaviour as the PR stands now? |
Exactly. |
Awseome.. ok Personally I feel like this doesn't go far enough to allow permission requests, but I understand it is still an improvement over what the plugin is doing now. Since this can be further improved later, I've written a snippet that I think we could probably include at the end of the
Also, I'm not certain if the iOS claim is accurate. I know this PR doesn't touch iOS, but we should double check iOS behaviour if possible. Unfortunately I'm not in the position to check this myself as I do not have access to a Mac. If we are unable to check the behaviour, then it might be better to scratch the Outside of that, I think the PR is good but I'll request further input from a couple of other members who have worked more closely with the IAB than I have. Note, I added the |
I only tested video, but during my tests I could use webcam and mic access on devices with iOS version 14.3 or higher - That's then WebRTC was introduced in WKWebKit, which is what IAB on iOS uses, as far as I am aware. With the issue being reported prior to iOS 14.3 release (dec 14th 2020), and that I was able to use permission sensitive features from iOS's IAB during my tests, I would highly suspect it was entirely due to not supporting WebRTC on iOS, rather than having permissions passthrough issues. |
Ok, so we can probably scratch the iOS claim in my snippet.
|
After setting the permissions I got the camera working on Android with this PR. I think it should be good to go with the small note in README. I tested it on iOS, too and at least for my only real iOS device (iPad with iOS 16.1 beta) the camera does not work in the IAB. |
@NiklasMerz could you please approve above PR |
Please Merge this to master |
I have tried with the above solution, adding the permission in AndroidManifest.xml and granted the access. But I still not be able to open the camera when using IAB. The website is using the input tag <input type="file" id="myFile" name="filename" accept="image/*> to get the input. |
Any news on this? We need camera access for file type=input :) |
@NiklasMerz any reason the review and merge is being delayed? People are waiting on this. thx! @breautek Niklas seems inactive lately. Any change you could review or add someone (like me for example) to merge this? |
The fix is working. Thank you |
@breautek If you think this fine feel free to merge. I could create a new release if we think it's a good time to do that. |
Co-authored-by: joanb-moncasoft <55381916+joanb-moncasoft@users.noreply.github.com>
Solution worked for me , for camera access With in your index.js var permissions = cordova.plugins.permissions; Step 2 : step 3 : step 4: |
@alexandrampolta camera access works but microphone access is still not working in inappbrowser. Did you try it? |
Platforms affected
Android
Motivation and Context
Android in-app-browser does not allow in-browser camera/webcamera usage (permission denied)
With this change, camera usage will be allowed as long as the app has permissions.
Issue GH-706: #706
Description
Allows permissions requests from ChromeWebView
Testing
IAB would show permissions denied error in website https://webcam-test.com/
After the changes it successfuly works (requires app's camera permission to be enabled)
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)