Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const askForContactPermissionsIOS = async () => {
const {Permissions} = require('react-native-unimodules')
const {status} = await Permissions.askAsync(Permissions.CONTACTS)
return expoPermissionStatusMap()[status]
}
const loadContactPermissionFromNative = async () => {
if (isIOS) {
const {Permissions} = require('react-native-unimodules')
return expoPermissionStatusMap()[(await Permissions.getAsync(Permissions.CONTACTS)).status]
}
return (await PermissionsAndroid.check(PermissionsAndroid.PERMISSIONS.READ_CONTACTS))
? 'granted'
: 'undetermined'
}