Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On IOS I get locations that have a distance to the previous locations of les than 3m while the stationaryRadius and distanceFilter is set to 50m #157

Open
koendecock opened this issue Aug 30, 2023 · 3 comments

Comments

@koendecock
Copy link

Describe the bug
I'm testing this great plugin on my IOS device. I've set stationaryRadius and distanceFilter to 50 but I'm receiving location events for locations which are less than 3 meters separated. My understanding of the documentation is that I should only get location events when the distance to the previous location is more than 50 meters.

This is my configuration:
BackgroundGeolocation.configure({
locationProvider: BackgroundGeolocation.DISTANCE_FILTER_PROVIDER,
//locationProvider: BackgroundGeolocation.RAW_PROVIDER,
desiredAccuracy: BackgroundGeolocation.HIGH_ACCURACY,
stationaryRadius: 50,
distanceFilter: 50,
notificationTitle: 'Background tracking',
notificationText: 'enabled',
debug: false,
interval: 10000,
fastestInterval: 5000,
activitiesInterval: 10000,
url: 'http://192.168.81.15:3000/location',
httpHeaders: {
'X-FOO': 'bar'
},
// customize post properties
postTemplate: {
lat: '@latitude',
lon: '@longitude',
foo: 'bar' // you can also add your own properties
}
});

Expected behavior
I expect the receive locations events when the user has moved at least 50 meters.

Screenshots
I've attached a screenshot showing the distance to the previous location in meters for each location in the getValidLocations() list.
I calculated the distance between two locations with the open layers getDistance function (https://openlayers.org/en/latest/apidoc/module-ol_sphere.html#.getDistance).

Smartphone (please complete the following information):

  • Device: iPhone12pro
  • OS: iOS16.6

Additional context
Screenshot 2023-08-30 at 10 56 50

Add any other context about the problem here.

@HarelM
Copy link
Collaborator

HarelM commented Aug 30, 2023

I would recommend looking at the code and trying to debug this.
It might be that this is what we configure the iOS provider and still get too close locations.

@koendecock
Copy link
Author

Hi @HarelM, thanks for your reply but I'm not familiar at all with IOS code. I'm using cordova to be able to write native application with my JS, HTML, CSS and React JS skills ;-) I was hoping someone with IOS code skills and knowledge on this great plugin could take a look at this issue.

@HarelM
Copy link
Collaborator

HarelM commented Sep 1, 2023

You should be able to open xcode and connect the device to be able to debug you app.
You can also try and investigate the plugin's logs.
Worst case, you can use the raw provider and filter the locations yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants