How to use the react-native-unimodules.Permissions.CONTACTS function in react-native-unimodules

To help you get started, we’ve selected a few react-native-unimodules examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keybase / client / shared / actions / platform-specific / index.native.tsx View on Github external
const askForContactPermissionsIOS = async () => {
  const {Permissions} = require('react-native-unimodules')
  const {status} = await Permissions.askAsync(Permissions.CONTACTS)
  return expoPermissionStatusMap()[status]
}
github keybase / client / shared / actions / platform-specific / index.native.tsx View on Github external
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'
}