react-native-android-location
Location acquisition through Network or GPS from android device without using Google Play Service.
Installation
Install the npm package
npm i --save react-native-android-location
Add it to your android project
- In
android/settings.gradle
...include ':RNAlocation', ':app'project(':RNAlocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-location')
- In
android/app/build.gradle
...dependencies { ... compile project(':RNAlocation')}
- register module (in MainActivity.java)
// <--- import
Add permissions to your Project
Add this to your AndroidManifest file;
// file: android/app/src/main/AndroidManifest.xml
Example
'use strict'; var React = ; // For registering the Callback-Listenervar DeviceEventEmitter = ; var RNALocation = ; var AppRegistry StyleSheet Text View = React; var RNALocation = React; var styles = StyleSheet; AppRegistry;