index01d / react-native-background-geolocation-example

Example app of react-native-mauron85-background-geolocation component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Native Background Geolocation Example



This is an example app of react-native-mauron85-background-geolocation component.

Binary build

There is apk in dist folder.

How to build

In cloned directory:

  1. npm install

Also read setup instructions.


Check android lib versions:

Name Version
Google Play Services >=30
Google Repository >=28

Generate your SHA1 key to restrict usage to your app only (optional):

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Go to Google API Console and select your project, or create new one:

In Overview -> Google Maps API -> Google Maps Android API -> Check if it's enabled. If not, click button Enable! Create a new key by clicking on Create credentials -> API Key -> Android Key, enter the name of the API key and your SHA1 key, generated before, and create it.

Add Google Maps Android API Key in android/app/src/main/res/values/strings.xml:

    <string name="google_api_key">{{Your Google maps API Key Here}}</string>

Module react-native-maps v0.8.2 requires Google Play Services library version 9.4.0, we need to change node_modules/react-native-mauron85-background-geolocation/android/lib/build.gradle

dependencies {
    compile ''

More info

Run in Simulator

adb reverse tcp:8081 tcp:8081

react-native run-android

Run on Device

$ cd android && ./gradlew installDebugAndroidTest


in iOS Simulator: Enable Freeway Drive in DebugLocation menu.

Run in Simulator

react-native run-ios



Check adb logcat for errors. For example wrong API key:

E/Google Maps Android API(31792): Authorization failure.  Please see for how to correctly set up the map.
E/Google Maps Android API(31792): In the Google Developer Console (
E/Google Maps Android API(31792): Ensure that the "Google Maps Android API v2" is enabled.
E/Google Maps Android API(31792): Ensure that the following Android Key exists:
E/Google Maps Android API(31792): 	API Key: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA                                             
E/Google Maps Android API(31792): 	Android Application (<cert_fingerprint>;<package_name>): 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;com.rnbgexample
ezoic increase your site revenue


Example app of react-native-mauron85-background-geolocation component.


Language:JavaScript 66.2%Language:Objective-C 19.8%Language:Python 7.5%Language:Java 6.5%