Checking Apple Health permissions

Is it safe to call HKHealthStore authorizationStatus() and getRequestStatusForAuthorization() on the main thread? It seems that these methods occasionally block.

Any best practices for guiding a user to grant all required Apple Health permissions for a workout app? Because of privacy concerns, its difficult to know what permissions a user has granted or denied in order to guide them appropriately.

Answered by Frameworks Engineer in 892676022

It is safe to call both those APIs from the main thread.

A general best practice is to specify how your app uses the health data. See https://developer.apple.com/documentation/healthkit/protecting-user-privacy?language=objc#Specify-how-your-app-uses-the-health-data

Permissions are unreliable. I have submitted bug reports about permissions for years. I am still waiting for any fix.

It is safe to call both those APIs from the main thread.

A general best practice is to specify how your app uses the health data. See https://developer.apple.com/documentation/healthkit/protecting-user-privacy?language=objc#Specify-how-your-app-uses-the-health-data

Checking Apple Health permissions
 
 
Q