Skip to content

Instantly share code, notes, and snippets.

@dceddia
Created June 15, 2018 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dceddia/9bb7de0acb5c1ad3fa226f471998ab81 to your computer and use it in GitHub Desktop.
Save dceddia/9bb7de0acb5c1ad3fa226f471998ab81 to your computer and use it in GitHub Desktop.
Asking for permission to use the camera.
export default class App extends React.Component {
...
componentDidMount() {
Permissions.askAsync(Permissions.CAMERA)
.then(({ status }) =>
this.setState({
cameraPermission: status === 'granted'
})
);
}
render() {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment