Created
June 15, 2018 02:03
-
-
Save dceddia/9bb7de0acb5c1ad3fa226f471998ab81 to your computer and use it in GitHub Desktop.
Asking for permission to use the camera.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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