react-native-instantpay-location-enabler
v1.0.2
Published
React Native App to ensure that the Android device's system settings are properly configured for the app's location needs.
Downloads
40
Maintainers
Readme
react-native-instantpay-location-enabler
React Native module for checking Device Location is Enable or Disable. Support only for Android.
TOC
Installation
npm install react-native-instantpay-location-enabler
Manual installation
Android
- 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')
Usage
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 |
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Created By Instantpay