Coder Social home page Coder Social logo

ets-reactnative3 / react-native-background-geolocation-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mauron85/react-native-background-geolocation-example

0.0 0.0 0.0 12.23 MB

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

JavaScript 81.88% Ruby 3.88% Objective-C 7.79% Java 3.07% Starlark 3.38%

react-native-background-geolocation-example's Introduction

React Native Background Geolocation Example

Screenshot

Intro

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

How to build

In cloned directory:

yarn install

Android

Check android lib versions:

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

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:

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

Run on device (or simulator)

react-native run-android

iOS

Run on device (or simulator)

react-native run-ios

Enable Freeway Drive in Debug โžœ Location menu in iOS Simulator.

Quirks

Android

For compatibility with react-native-maps v0.20.1 library versions were locked in root build.gradle file:

ext {
    compileSdkVersion   = 23
    targetSdkVersion    = 23
    buildToolsVersion   = "23.0.3"
    supportLibVersion   = "23+"
    googlePlayServicesVersion = "11+"
    androidMapsUtilsVersion = "0.5"
}

More info https://github.com/react-community/react-native-maps/blob/v0.20.1/docs/installation.md

As version 0.20.1 of react-native-maps there is another issue, which was resolved by updating following lines in app/build.gradle:

compile(project(':react-native-maps')) {
    exclude group: 'com.google.android.gms', module: 'play-services-base'
    exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile "com.google.android.gms:play-services-base:11+"
compile 'com.google.android.gms:play-services-location:11+'
compile 'com.google.android.gms:play-services-maps:11+'

React-native-maps version 0.21 is not supported yet.

Troubleshoot

Android

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

E/Google Maps Android API(31792): Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
E/Google Maps Android API(31792): In the Google Developer Console (https://console.developers.google.com)
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

Mocking Locations & Test Server

Follow instruction in background-geolocation-server project.

react-native-background-geolocation-example's People

Contributors

bardiaalavi-2020 avatar mauron85 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.