mauron85 / react-native-background-geolocation

Background and foreground geolocation plugin for React Native. Tracks user when app is running in background.
Apache License 2.0
1.33k stars 561 forks source link

[Android] getLocations return empty array #522

Open arochedy opened 3 years ago

arochedy commented 3 years ago

Your Environment

Context

On compenentDidmount I do

   BackgroundGeolocation.getLocations((locations) => {
        console.log('allLocations', locations);
        alert(JSON.stringify(locations));
      },(error) =>{
        alert('error')
      }

      );

Expected Behavior

Get alllocations store by the plugin

Actual Behavior

I get an empty array :(

Possible Fix

Steps to Reproduce

1. 2. 3. 4.

Context

It's work on iOs but not an android (simulator and real device)

Debug logs

wy10 commented 3 years ago

I've had this problem, too,How did you solve it?