react-native-location: subscribeToLocationUpdates() rarely returns new locations on Android

On Android, subscribeToLocationUpdates() returns a set of locations the first time it’s called, but after that, it sends a new locations array extremely infrequently - on the order of once every 10 minutes (even if moving significantly). Fine location access is authorized.

On iOS, the method works as expected (using the same code below).

Relevant code is below. Are there any other settings I can adjust?

RNLocation.configure({
  distanceFilter: null, // have tried 0, 1, 10, 100
  desiredAccuracy: {
    ios: 'best',
    android: 'highAccuracy'
  }
});
unsubscribe = RNLocation.subscribeToLocationUpdates((locations) => {
  Alert.alert('locations', JSON.stringify(locations));
});

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Most upvoted comments

Glad to hear it! Thanks for prompting me to add these.

Works perfectly. Thank you so much for the wonderful library!