React Native application to display geolocations after enabling gps using react-native.
yarn add react-native-android-location-services-dialog-box
or
npm install react-native-android-location-services-dialog-box --save
react-native link react-native-android-location-services-dialog-box
yarn add react-native-android-location-services-dialog-box
or
npm install react-native-android-location-services-dialog-box --save
- Make the following additions to the given files:
android/settings.gradle
include ':react-native-android-location-services-dialog-box'
project(':react-native-android-location-services-dialog-box').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-location-services-dialog-box/android')
android/app/build.gradle
dependencies {
...
compile project(':react-native-android-location-services-dialog-box')
}
MainApplication.java
On top, where imports are:
import com.showlocationservicesdialogbox.LocationServicesDialogBoxPackage;
Under protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new LocationServicesDialogBoxPackage() // <== this
);
GEO 1 | GEO 2 | GEO 3 |
---|---|---|