This bug has been affecting different users (iPhone 11,2 - iPhone12,3, etc...) on different iOS versions (iOS 15.x.x) This was also seen on Xcode 12.5 simulator -> but “not yet” on Xcode 13.2) Repro:
- When launching our app, we call healthStore.requestAuthorization on viewDidLoad of a view controller
- HealthKit prompts us with permission screen, we turn on all, everything works in-app
- User put the app in the background and go to Settings -> Health .... and check that all permissions are turned on for our app successfully
- User restart our app
- User keeps on getting prompted for a subset of permissions (eg: I have been getting specifically: active energy, cycling distance, heart rate, swimming distance walking + running distance (both read and write requests)
- While request is still open, go back to Settings -> Health .... and we see that those permissions have been toggled off automatically. Expected Behavior:
OS should not automatically reset permissions that were provided by the user, it provides bad experience since we now need to prompt the user every time (by using expected behavior of healthStore.requestAuthorization)
Apple is not being responsive