0.0.5 • Published 2 years ago

react-native-android-location-setting-enabler v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
2 years ago

react-native-android-location-setting-enabler

Getting started

$ npm install react-native-android-location-setting-enabler --save

Mostly automatic installation

$ react-native link react-native-android-location-setting-enabler

Manual installation

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  • Add import com.reactron.react.settingenabler.RNAndroidLocationSettingEnablerPackage; to the imports at the top of the file
  • Add new RNAndroidLocationSettingEnablerPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-android-location-setting-enabler'
    project(':react-native-android-location-setting-enabler').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-android-location-setting-enabler/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      implementation project(':react-native-android-location-setting-enabler')

Usage

import RNAndroidLocationSettingEnabler from 'react-native-android-location-setting-enabler';

RNAndroidLocationSettingEnabler API.

FunctionArgumentsReturnsNote
checkLocationSettingStatusoptions: LocationSettingRequestPromise<void>Check if location setting satisfies the request, the promise resolve if the location setting satisfies, reject otherwise
checkAndEnableLocationSettingoptions: LocationSettingRequestPromise<void>Check if location setting satisfies the request, if not, try to enable location setting.

Constants

RNAndroidLocationSettingEnabler.PRIORITY_BALANCED_POWER_ACCURACY: number;
RNAndroidLocationSettingEnabler.PRIORITY_HIGH_ACCURACY: number;
RNAndroidLocationSettingEnabler.PRIORITY_LOW_POWER: number;
RNAndroidLocationSettingEnabler.PRIORITY_NO_POWER: number;
0.0.5

2 years ago

0.0.3

5 years ago

0.0.4

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago