@okhi/react-native-core
v1.3.2
Published
Core package for the OkHi react native suite of libraries
Downloads
7
Readme
@okhi/react-native-core
Core package for the OkHi react native suite of libraries
Installation
npm install @okhi/react-native-core
Usage
import {
isGooglePlayServicesAvailable,
isLocationPermissionGranted,
isLocationServicesEnabled,
requestEnableGooglePlayServices,
requestEnableLocationServices,
requestLocationPermission,
isBackgroundLocationPermissionGranted,
requestBackgroundLocationPermission,
} from '@okhi/react-native-core';
async function checkPermissions() {
if (!(await isGooglePlayServicesAvailable())) {
await requestEnableGooglePlayServices(); // resolves true | false
}
if (!(await isLocationPermissionGranted())) {
await requestLocationPermission(); // resolves true | false
}
if (!(await isLocationServicesEnabled())) {
await requestEnableLocationServices(); // resolves true | false
}
if (!(await isBackgroundLocationPermissionGranted())) {
await requestBackgroundLocationPermission(); // resolves true | false
}
}
Documentation
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT