I have a HKHealthStore object properly set up, and I am now trying to write user characteristics (ie Date of Birth, Biological Sex, Blood Type and Fitzpatrick Skin Type). I can't find that type in HKQuantityTypeForIdentifier
. How do I write blood type to HealthKit in Objective-C
? I am trying the following:
int Dateofbirth=20-10-1995;
NSLog(@“%d”, Dateofbirth);
sex=gender;
BloodType= A+ve;
Fitzpatrick Skin Type= something;
HKQuantityType* bodytemp = [HKQuantityType quantityTypeForIdentifier: HKQuantityTypeIdentifier];
You may have to use characteristicTypeForIdentifier:
with HKBloodType
.
Constants from Blood type:
typedef enum : NSInteger {
HKBloodTypeNotSet = 0,
HKBloodTypeAPositive,
HKBloodTypeANegative,
HKBloodTypeBPositive,
HKBloodTypeBNegative,
HKBloodTypeABPositive,
HKBloodTypeABNegative,
HKBloodTypeOPositive,
HKBloodTypeONegative,
} HKBloodType;
There is no API to modify user characteristics. The user must update the characteristics themselves in Health.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.