John.Cena's.Fans
John.Cena's.Fans

Reputation: 51

Error Domain=com.apple.healthkit Code=5

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

Answers (1)

John.Cena's.Fans
John.Cena's.Fans

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

Related Questions