I have a health kit object with all the proper setup; however, I am trying to retrieve the menstruation data of health kit.
However, I cannot be able to find out the corresponding type in HKQuantityTypeIdentifier
(i.e. HKCategoryValueMenstrualFlow
).
The HKCategoryValueMenstrualFlow
is having some of the sub items such as HKCategoryValueMenstrualFlowLight
, HKCategoryValueMenstrualFlowMedium
, HKCategoryValueMenstrualFlowHeavy
. Using the following method, I am writing my code like this:
-(void)viewDidLoad {
HKHealthStore *healthStore = [[HKHealthStore alloc] init];
HKCategoryType *q=[NSSet setWithObjects:
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowHeavy],
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowMedium],
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowLight],
[HKCategoryType categoryTypeForIdentifier:HKCategoryValueMenstrualFlowUnspecified],nil];
[healthStore requestAuthorizationToShareTypes:shareObjectTypes readTypes: healthStore completion:^(BOOL success, NSError *error) {
if(success == YES) {
}
}
I am writing like this. But my doubt is how to show the details in menstruation data in the health kit app. Please tell me anybody by providing me with any idea. Thanks in advance.