@okhi/react-native-core
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

@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

Package Sidebar

Install

npm i @okhi/react-native-core

Weekly Downloads

0

Version

1.3.2

License

MIT

Unpacked Size

345 kB

Total Files

130

Last publish

Collaborators

  • teamokhi
  • kiano