Reputation: 51
HKSampleType *stepType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount];
when i want the steps ,it works;
and i want the DistanceWalkingRunning
or ExerciseTime
, xcode show me the next message。
Error Domain=com.apple.healthkit Code=5 “Authorization not determined
UserInfo={NSLocalizedDescription=Authorization not determined}”
HKSampleType *walkingType = [HKQuantityType quantityTypeForIdentifier:
HKQuantityTypeIdentifierAppleExerciseTime];
somebody help me please. Thanks.
Upvotes: 3
Views: 1027
Reputation: 51
HKObjectType *stepType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierDistanceWalkingRunning];
NSSet *healthSet = [NSSet setWithObjects:stepType,nil];
It's too embarrassing! Just get the step's authorization, without the distance's.
Upvotes: 2