Skip to content
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

WebView should handle onPermissionRequest for device resources #11610

Closed
alioguzhan opened this issue Dec 23, 2016 · 16 comments
Closed

WebView should handle onPermissionRequest for device resources #11610

alioguzhan opened this issue Dec 23, 2016 · 16 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@alioguzhan
Copy link

alioguzhan commented Dec 23, 2016

Description

I need to use RN's WebView module in my Android app for WebRTC. But according to here, there is a class named PermissionRequest, stands for allowing to use device resources:

This class defines a permission request and is used when web content requests access to protected resources

And looks like RN's WebView does not handle this. So we cannot use device camera or microphone for WebRTC apps. Local camera and mic do not work in the webview.

Reproduction

Solution

However, I created a native webview module extending SimpleViewManager and just put these 3 lines:

webview.setWebChromeClient(new WebChromeClient(){
        // Need to accept permissions to use the camera
        @Override
        public void onPermissionRequest(final PermissionRequest request) {
            request.grant(request.getResources());
        }
    });

With this, WebView just worked as expected. Device camera and microphone works flawlessly.
I tried to extend RN's WebView and put these 3 lines but didn't go well.

  • React Native version: 0.39.2
  • Platform: Android
  • Operating System: MacOS
@LucasSouzaa
Copy link

LucasSouzaa commented Feb 23, 2017

Did you solve your problem? I'm exactly with the same problem...

@alioguzhan
Copy link
Author

alioguzhan commented Feb 23, 2017

@LucasSouzaa No. i rewrote my own Android Webview App with my custom bridges and configuration. And moved from react native to react for now. No one interested this issue so far :/

@alfonsodev
Copy link

@alioguzhan do you have your extended component in a repo ?

@andrewhine-gat
Copy link

Any update on this?

@dave-irvine
Copy link

@alioguzhan It would be great if you could share the solution that you did manage to get working.

@JJMoon
Copy link

JJMoon commented Jul 28, 2017

Same Problem in RN 0.46.

@pull-bot
Copy link

pull-bot commented Oct 9, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos added the Icebox label Oct 9, 2017
@hramos hramos closed this as completed Oct 9, 2017
@AAGSICON
Copy link

AAGSICON commented Jan 9, 2018

can you please share your code?
My application have this issue.
I could not get any solution.
can you please share it.

@alioguzhan
Copy link
Author

Hi, it's been long time. The project belongs to my previous company. I don't have access to the code anymore :/

@AAGSICON
Copy link

AAGSICON commented Jan 9, 2018

Are you have any idea about it?

@alioguzhan
Copy link
Author

Not now. But i will check my previous projects when i am home, today. If i ll find any sample code related to this issue, i will put it here.

@AAGSICON
Copy link

AAGSICON commented Jan 9, 2018

OK Thanks

@wysiecki
Copy link

Hi, my way ended also here, any help ?

@alioguzhan
Copy link
Author

I couldn't find my custom webview's source code. If i have enough time, i can re-write it. It is not that complicated. But there is another issue i believe.

I created this issue more than one year ago and people having this issue ended up here many times. @hramos labeled this issue as icebox which means they consider this is not priority.

It would be great and helpful if someone from maintainers give us an explanation about this issue.

@diegolaciar
Copy link

+1, solution for this is welcome, I have the same issue

@Titozzz
Copy link
Collaborator

Titozzz commented Sep 26, 2018

Please open an issue on react-native-community/react-native-webview as this won't get fixed here @diegolaciar

@facebook facebook locked as resolved and limited conversation to collaborators Oct 9, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests