My app is highly based on CLLocation timestamp. I found that CLLocationManager updates location in ~1s intervals. It's not enough for my app. Is it possible to configure CLLocationManager to update location in shorter intervals or should I look for other approach (timers + ask manually for location)?
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation
locationManager.allowsBackgroundLocationUpdates = true
locationManager.distanceFilter = kCLDistanceFilterNone
if #available(iOS 11.0, *) {
locationManager.showsBackgroundLocationIndicator = true
}
locationManager.startUpdatingLocation()
timer + requestLocation() doesn't work.
You cannot change frequency of updates. But you probably don't need that. You can calculate phone position by using CMMotionManager framework and you can get the user location using CLLocationManager framework.
Use accelerometer to calculate device movement. From didAccelerate method you can get x, y and z of move, so by applying this to detected user location you can calculate new device position.
Hope this helps and good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With