The Watch App and iPhone App health care permissions are not synchronized.

I developed an iPhone/Watch app with the single target setting (new method) for Watch app projects, which will be available from Xcode14. This app uses HealthKit to retrieve information such as step count and heart rate from healthcare. The watch app is not independent and requires the iPhone app (companion app).

Regarding the permission to access health care, i found some differences from the Old WatchApp Project (application project structure using WatchExtension when Xcode 13.4 or lower is used).

  • This does not occur in the iPhone simulator or watch simulator, but only on the actual device.
  • Both the iPhone app and watch app now display a dialog to allow access to health care
    • In the Old WatchApp Project, if access was granted in either app, the granted access is synchronized.
  • When checking the Health Care access status in the iPhone Settings App, permission settings for both the iPhone app and watch app are displayed independently.
    • Because each permission setting is independent, you can choose to allow access to the iPhone app but not to allow it to the watch app.
    • the Old WatchApp Project, permission settings for the iPhone app and watch app were synchronized, so it was not possible to have different settings for each.

These behaviors are not described in the documentation. It would be understandable if the transition from watch "extension" to watch "app" is to split the app into two separate units.

However, since there is no official documentation explaining this, i cannot determine whether this is the correct specification or not. Furthermore, since the companion app is required rather than a separate Watch app, having the Health Care permission settings out of sync with the companion app could cause unexpected problems and worsen the user experience. (It would be difficult and cumbersome for the user to know what settings they have made).

Is there a solution to synchronize this behavior with the companion app like as the Old WatchApp Project? Do i have to go back to the project configuration (use of watchExtension) before Xcode13?

I have prepared a sample project below that can test the above. https://github.com/HayakawaAKIRA/SingleTargetWatchOSApp-HealthKit

reference:

https://developer.apple.com/videos/play/wwdc2022/10133/ https://developer.apple.com/documentation/watchkit/wkapplication https://developer.apple.com/documentation/healthkit/setting_up_healthkit

  • I have exactly the same issue with a workout app and its iPhone companion app. HealthKit seems to be out of sync, it's like we have 2 different app reading and writing in 2 different HealthKit stores. I haven't found any documentation on that ...

  • (Luckily it seems) I haven't made the switch yet. I have problem syncing HealthKit on Simulator with paired iPhone and Watch. Two different Stores, units, permissions, everything.

  • This must be a bug on apple's part. I have my developer devices (iPhone 16.0 (20A362), Watch 9.1 (20S5055e)) totally out of sync and my personal devices (iPhone 16.0 (20A362), Watch 9.0 (20R364)) working perfectly. Both are running the exact same version of my app (thru TestFlight). Dunno if it's the developer iCloud account or the beta software on the watch.

Replies

From my analysis this is an issue in watchOS 9.1 Beta. I now have two "debug" Apple Watches paired to my "debug" iPhone. One iCloud account all across of course.

Sync from iPhone to Apple Watch with public watchOS 9.0 works flawlessly, with watchOS 9.1 beta: no dice.

I've just recently moved my Apple Watch app to a single target and some new users of the app are now complaining that the phone companion app is not showing their workouts. From looking at screenshots they have seen me it seems the phone is not using the HealthKit permissions that the Watch app has requested and had a approved.

Did anyone get to the bottom of this to find out if its expected behaviour and or if it was fixed in a later version of WatchOS?

  • This issue should have been resolved in later watchOS 9.x versions and in watchOS 10.0. Could you confirm which iOS/watchOS builds your users are running?

  • Thanks for the reply. From the users that have told me about the issue they all seem to be on 8.8. Do you know what version of 9 it was resolved in? I'm going to have to put a workaround in my app where I look for all workouts on certain versions of WatchOS 8 & 9 (rather than limiting my app as the source) due to this issue. I'd rather only do this on watchOS version that have the bug as I assuming having a less specific predicate will result in slower HealthKit fetches.

Add a Comment