samuel
samuel

Reputation: 63

How to access camera through webview in react native

I am trying to load a webpage (that must access the camera) on WebView using react native .But i can't access the camera through webview in react native android app.

Upvotes: 4

Views: 5167

Answers (2)

Israr Shaikh
Israr Shaikh

Reputation: 46

It is possible to use the Camera from within a WebView on iOS, just Use

<key>NSCameraUsageDescription</key>
<string>${PRODUCT_NAME} PhotoLibrary Usage</string>

steps are given below in images:

Open info.plist with Source Code

Paste the above code here

Upvotes: 3

Rob Walker
Rob Walker

Reputation: 905

Looks like it is possible to use getUserMedia from within a WebView on Android, but not iOS - can-i-use-navigator-mediadevices-getusermedia-in-android-ios-webview

Check this out for a way to do it in iOS (but it looks like it will require a custom iOS module) - access-camera-from-uiwebview

Upvotes: 0

Related Questions