react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

Android background geolocation

Open dukvanduken opened this issue 1 year ago • 8 comments

Hi there! I tried to find free solution for background location for Android RN app and used this react-native-geolocation lib.

But it seems it not support background geolocation. I used this code: ` useEffect(() => { Geolocation.setRNConfiguration({ skipPermissionRequests: false, locationProvider: 'android', })

Geolocation.watchPosition(
  ({ coords: { latitude: lat, longitude: lon }}) => {
    // my code here...
  },
  (error) => console.error(error),
  { interval: 1000, enableHighAccuracy: true, distanceFilter: 1 },
)

}, []) `

It works fine but only app is in focus. Backgrounded app do not watch for position.

I saw this module https://github.com/transistorsoft/react-native-background-geolocation but it's paid and I want to use this lib.

Do I have any possibilities to get background location?

dukvanduken avatar Jun 02 '23 17:06 dukvanduken

+1

GabrielDuarteJr avatar Jun 14 '23 19:06 GabrielDuarteJr

Also interested ✋

JB712 avatar Jun 28 '23 13:06 JB712

I need this as well!

DeveloperMCD avatar Jun 28 '23 23:06 DeveloperMCD

A workaround is provided in PR #247, if you want to patch it by yourself

JB712 avatar Jun 29 '23 09:06 JB712

+1

thtRajasthaniGuy avatar Aug 15 '23 12:08 thtRajasthaniGuy

I'll try to work on this feature when I'll have some spare time :)

michalchudziak avatar Aug 29 '23 20:08 michalchudziak

+1

NgVSang avatar Sep 18 '23 00:09 NgVSang