Created
November 19, 2020 22:12
-
-
Save ShanikaNishadhi/4cbb1e9dfbe593893ef003a4d034eda8 to your computer and use it in GitHub Desktop.
This file contains 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
import {check, PERMISSIONS, RESULTS} from 'react-native-permissions'; | |
check(PERMISSIONS.IOS.CAMERA) | |
.then((result) => { | |
switch (result) { | |
case RESULTS.UNAVAILABLE: | |
console.log( | |
'feature is not available', | |
); | |
break; | |
case RESULTS.DENIED: | |
console.log('permission has not been requested / is denied but requestable',); | |
break; | |
case RESULTS.GRANTED: | |
console.log('The permission is granted'); | |
break; | |
case RESULTS.BLOCKED: | |
console.log('The permission is denied and not requestable anymore'); | |
break; | |
} | |
}) | |
.catch((error) => { | |
// … | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment