Itβs hard for me to get HealthKit for my iOS app. I took all the steps I found so far and no one seems to be solving my problem. I keep getting this error when trying to authorize Healthkit:
Error Domain=com.apple.healthkit Code=4 "Missing com.apple.developer.healthkit entitlement." UserInfo=0x78fa24e0 {NSLocalizedDescription=Missing com.apple.developer.healthkit entitlement.}
Here is my code requiring authorization:
if([HKHealthStore isHealthDataAvailable]) { self.healthStore = [[HKHealthStore alloc] init]; [self.healthStore requestAuthorizationToShareTypes:nil readTypes:[self dataTypesToRead] completion:^(BOOL success, NSError *error) { if (!success) { NSLog(@"HK Error: %@", error); [self presentHealthAlert:@"You didn't allow APP to access HealthKit Data. Please go to Settings and set up APP permissions." withTitle:@"Error"]; } else { [self presentHealthAlert:@"Thank You For Access" withTitle:@"Success"]; } }]; } else { [self presentHealthAlert:@"Health Data Not Available" withTitle:@"Success"]; }
And yes, I included it in my Capabilites project, and yes, I included it in my Dev Center app ID. Is there anything else I can lose?
source share