React Native module for checking Device Location is Enable or Disable. Support only for Android.
npm install react-native-instantpay-location-enabler
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
import com.instantpaylocationenabler.InstantpayLocationEnablerPackage;
to the imports at the top of the file - Add
new InstantpayLocationEnablerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-instantpay-location-enabler' project(':react-native-instantpay-location-enabler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-instantpay-location-enabler/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-instantpay-location-enabler')
import RNLocationEnabler from 'react-native-instantpay-location-enabler';
// ...
let res = await RNLocationEnabler.checkLocation();
Note about checkLocation Method
Possible options values :
key | Description | type | required |
---|---|---|---|
askDailogPermission | Request to Open Dialog Permission | boolean | Optional |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Created By Instantpay