Posts

Post marked as solved
1 Replies
596 Views
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
Posted
by tompfe.
Last updated
.
Post not yet marked as solved
0 Replies
625 Views
Hi A watchOS app that has the property 'Required Background mode (Watch)' set to 'Workout processing' always stay in the foreground. This is what I want and correct. But, the app stays in the foreground regardless if there is an active HKWorkoutSession or not. During an active HKWorkoutSession this is perfectly fine but before a workout has started of after it has ended the app should not stay in the foreground. The only possibility a user has is to use the app-switcher and kill the app, otherwise it will always come to the foreground. Is there a possibility to set the 'required background mode' at runtime? Or any other possibility to control if the app should stay in foreground or not? many thanks for any help Thomas
Posted
by tompfe.
Last updated
.