0
在我的應用程序中,我使用的是HealthKit,一切順利。 授權使用此代碼如何撤銷HealthKit授權
NSArray *readTypes = @[
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount],
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate],
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierActiveEnergyBurned] ];
NSArray *writeTypes = @[
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount],
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate],
[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierActiveEnergyBurned] ];
[self.healthStore requestAuthorizationToShareTypes:[NSSet setWithArray:writeTypes]
readTypes:[NSSet setWithArray:readTypes] completion:^(BOOL success, NSError * _Nullable error) {
NSLog(@"Succes ==>%d",success);
NSLog(@"error ==>%@",error);
}];
現在我要撤銷它做,怎麼樣?請幫幫我。