Open GunnarAK opened 3 years ago
Not sure what the issue is, using useSignificantChanges: true
means ios will wait a long period of time before triggering next update. So it should not happen. Is this happening in real device or in simulator ?
Hi Agontuk, yes this is happening on a real device, iOS 14. I changed the console.log's as such:
console.log("watchPosition - change", positionWatcher);
As can be seen in the screenshot just 1 watcher is active.
The first two logs with "watchPosition - change" take their time, but after I see it getting triggered every second. Finishing this post it has reached 300+ logs.
Not sure what the issue is. Can you try running the example project and see if it behaves the same way ?
It's updating for me every second too. Could you solve it?
I am facing the same issue, I am only working with Android can't say for IOS, and here is my options object:
{
interval: 5000,
timeout: 10000,
maximumAge: 0,
enableHighAccuracy: true,
distanceFilter: 0,
fastestInterval: 5000,
}
And the here is my config:
Geolocation.setRNConfiguration({
authorizationLevel: 'always',
enableBackgroundLocationUpdates: true,
locationProvider: 'auto',
});
When the distance filter is set to 0, (as per as docs when set to 0 filter is removed, default is 100), the interval option is being neglected, although i am setting it to 5 seconds, its generating points rapidly every second.
Here is the result:
LOG {"coords": {"accuracy": 11.45981216430664, "altitude": -53.4263916015625, "heading": 0, "latitude": 22.46255064, "longitude": 88.36568368, "speed": 0}, "extras": {"maxCn0": 32, "meanCn0": 23, "satellites": 13}, "mocked": false, "timestamp": 1715871599000} 8:29:58 pm points generated!
LOG {"coords": {"accuracy": 11.193303108215332, "altitude": -53.4288330078125, "heading": 0, "latitude": 22.46255063, "longitude": 88.36568368, "speed": 0}, "extras": {"maxCn0": 33, "meanCn0": 22, "satellites": 14}, "mocked": false, "timestamp": 1715871600000} 8:29:59 pm points generated!
LOG {"coords": {"accuracy": 11.19205093383789, "altitude": -53.4283447265625, "heading": 0, "latitude": 22.46255062, "longitude": 88.36568368, "speed": 0}, "extras": {"maxCn0": 32, "meanCn0": 22, "satellites": 15}, "mocked": false, "timestamp": 1715871601000} 8:30:00 pm points generated!
LOG {"coords": {"accuracy": 11.20115852355957, "altitude": -53.412567138671875, "heading": 0, "latitude": 22.46255054, "longitude": 88.36568366, "speed": 0}, "extras": {"maxCn0": 33, "meanCn0": 21, "satellites": 16}, "mocked": false, "timestamp": 1715871602000} 8:30:01 pm points generated!
as you can see i have printed the time stamp after each of them.
this is really giving me a hard time. Please provide a fix.
device tested on: POCO m2 pro.
As the title implies
watchPosition()
triggers every second for me. Setup:The same holds true when having the following options added to
watchPosition()
:Use in component:
In my console I can see the listener being added only once. Also the removal of said listener happens as expected, which assures me there are no other listeners active.
This is only happening on iOS (14)