mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 19:51:10 +00:00
Don't allow camera and mic permissions by default. Notify user about permission request
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import React, {Component} from 'react';
|
||||
import {Text, View} from 'react-native';
|
||||
|
||||
import WebView from 'react-native-webview';
|
||||
|
||||
type Props = {};
|
||||
type State = {};
|
||||
|
||||
export default class Permission extends Component<Props, State> {
|
||||
state = {};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={{ height: 120 }}>
|
||||
<WebView
|
||||
ref={(ref) => (this.webview = ref)}
|
||||
onPermissionRequest={(event) => {
|
||||
console.log("!!! JS: onPermissionRequest, event: ", event.nativeEvent);
|
||||
this.webview.answerPermissionRequest(false, event.nativeEvent.resources );
|
||||
}}
|
||||
source={{uri: 'https://fatal0.netlify.app/android/webviewvideo.html'}}
|
||||
automaticallyAdjustContentInsets={false}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user