Closed
Description
I tried to access the iOS camera within webview. but it's not working as expected. It's working fine in the Safari browser in iOS, Chrome browser in Android, and android webview. However, nothing happens inside webview in iOS. I granted required permissions like camera or audio, however, it still does not work.
Activity
mjurkowski commentedon Oct 19, 2020
The same issue
SimonBellucci commentedon Oct 26, 2020
The reason why you can't access the camera on iOS is because it relies on
mediaDevices.getUserMedia
andmediaDevices
is null in WKWebView browsers.On iOS-Devices camera access works only in native Safari and not in other Browsers (Chrome,...) or Apps that use an
UIWebView
orWKWebView
. This is not a restriction of this component but of the limited WebRTC support by Apple.This is still not resolved on iOS 14, if you want to stay updated on this topic, please refer to this thread.
sathwik77 commentedon Nov 30, 2020
@SimonBellucci So we don't have access to
getUserMedia
in Web View, but why does the docs say we can useNSCameraUsageDescription
? I was just wondering is there a way to open camera in IOS in web view?MarwaAbuEssa commentedon Dec 15, 2020
the same issue here
jayan2019 commentedon Dec 30, 2020
iOS 14.3 Supported
https://developer.apple.com/forums/thread/88052
Hope this will help!
wahaj-47 commentedon Feb 10, 2021
Attachment_1612945361.mp4
For me the camera opens up if I pass in the prop mediaPlaybackRequiresUserAction={false}. However the webview treats it like a live broadcast and I end up with nothing but a black screen. The camera is still open in the background so if you point it to a QR code, it scans it.
Edit: Adding the prop allowsInlineMediaPlayback and removing the mediaPlaybackRequiresUserAction prop seems to have fixed it.
github-actions commentedon Apr 12, 2021
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Zain228 commentedon May 6, 2021
Can you please show the code because i am doing all the things but not working
wahaj-47 commentedon May 6, 2021
Just add the props
On iOS it doesn't work on older iOS versions so I just listen to URL change events and open up a scanner using react-native-barcode-scanner on the correct URL.
Zain228 commentedon May 7, 2021
Okay then how you send scanned data to web? and is it working on latest iOS versions?
anhvoduy commentedon Jun 16, 2021
Camera does not work as simple Web View for IOS, please help:
HerickRaposo commentedon Jul 6, 2021
Could you display how to do this for us? Please i need to do this in two times during execution webview, one time with QR scanner and other with barcode scanner. Please helpme.
18 remaining items