Closed Rutvik-tbz closed 2 months ago
Every single location recorded by this plug-in, no matter how, ends up at .onLocation.
you can apply options.extras
(see api docs .getCurrentPosition) to your .getCurrentPosition request as a means of adding a flag to discern it in .onLocation.
const location = await BackgroundGeolocation.getCurrentPosition({
extras: {
getCurrentPosition: true // <-- an arbitrary flag of your choice
}
});
I want to get the current user location and for that, I use BackgroundGeolocation.getCurrentPosition(), I have also added BackgroundGeolocation.onLocation event listener
whenever I got the user's current location then this event listener call
I want to do like sometimes it calls event listener and sometimes not, it is possible ??
Your Environment
react-native -v
): 0.74.1