Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HealthKit HKAuthorizationStatus for reading data

I'm using HealthKit to read certain types of information. I'm specifically not asking for write functionality. The problem comes in when trying to detect if the user has allowed a certain Health type to be read.

I believe the intended way to do this is using an HKHealthStore's authorizationStatusForType method, but this is only returned denied or unknown. It is only returning authorized for write types. Has anyone found a way to use this method for reading or another work around?

HKQuantityType *stepsType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeight];
HKAuthorizationStatus status = [self.healthStore authorizationStatusForType:stepsType];
like image 735
Sean Avatar asked Aug 26 '14 18:08

Sean


People also ask

How does Apple HealthKit work?

It collects health and fitness data from your iPhone, the built-in sensors on your Apple Watch, compatible third-party devices, and apps that use HealthKit. The Health app is built to keep your data secure and protect your privacy. Your data is encrypted and you are always in control of your health information.

What is HealthKit on Apple Watch?

HealthKit provides a central repository for health and fitness data on iPhone and Apple Watch. With the user's permission, apps communicate with the HealthKit store to access and share this data.

How do I turn on HealthKit on Apple Watch?

Open the Health app. Tap your profile , then tap Devices. Tap your Apple Watch. Tap Privacy Settings and make sure Fitness Tracking is turned on.


1 Answers

For privacy reasons, you are unable to view your application's read authorization status for a particular type.

like image 59
jrushing Avatar answered Sep 29 '22 23:09

jrushing