CLLocationManager with watchOS10 not sending anything to didUpdateLocations:

My watch app records workouts including health (with HKWorkoutSession) and location data.The watch app is on the App Store and runs without any problems since long time. I updated my own Watch Ultra to watchOS10 and my app does not properly work anymore. Everything works with the exception that the app does not receive any CLLocationManager data on the physical device. On the simulator it works perfectly. I tried several devices in the simulator and they all work. Also I de-coupled the watch from the phone, deleted the watch completely and re-installed it.

  • My app's target is watchOS9, I tried it with watchOS10 and the problems are the same
  • CLLocationManager has correct and valid permissions
  • CLLocationManager is setup like this:
locationManager = CLLocationManager() 
locationManager.delegate = self
locationManager.allowsBackgroundLocationUpdates = true
locationManager.activityType = .fitness
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.distanceFilter = kCLDistanceFilterNone
locationManager.startUpdatingLocation()
  • CLLocationManager's delegate is listening to:
    func locationManager(_ manager: CLLocationManager, didFailWithError error: Error)   
    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) 
    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])

The CLLocationManager is starting and correctly giving feedback on 'didFailWithError' and on 'didChangeAuthorization'. Nothing that tells me that something is wrong and points to a problem.

No data is sent to didUpdateLocations. The function is never ever called. Of course I'm outside with my watch and the GPS signal is strong and I wait long enough.

My app is adding the recorded workout to Apple Fitness app (my app uses HKWorkoutSession) and even though my own app does not receive any CLLocationManager data, the workout that it sent to Apple Fitness includes all the CLLocationManager data. It really seems like being a problem with my app only.

Does someone have an idea or knows of a same problem?

Thomas

Accepted Reply

solved! The problem can be solved by resetting the 'Privacy & Location' settings (Settings / General / Reset / Privacy and Location)

Replies

solved! The problem can be solved by resetting the 'Privacy & Location' settings (Settings / General / Reset / Privacy and Location)