cph-cachet / carp.sensing-flutter

CARP Mobile Sensing for Flutter, including mobile sensing framework, data backend support, and the CARP mobile sensing app.
MIT License
80 stars 28 forks source link

Weather data always at Copenhagen location #349

Closed sc00n closed 1 year ago

sc00n commented 1 year ago

Weather data (ContextSamplingPackage.WEATHER) is always collected on the following location on iOS:

I/flutter (24464): "latitude": 55.7944, I/flutter (24464): "longitude": 12.4463,

This is because in location_manager.dart _lastKnownLocation is initialized as

Location _lastKnownLocation = Location(latitude: 55.7944, longitude: 12.4463);

In Android, where I use _ContextSamplingPackage.CURRENTLOCATION the location gets adapted after a while. On iOS, where I use ContextSamplingPackage.LOCATION, it does not adapt and the weather report is always on Copenhagen.

bardram commented 1 year ago

Fixed and published in carp_context_package version: 1.3.2.

I've removed the "last known location" and the probes are always trying to get the current location when asking for weather and air data.