diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m b/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m index 325493bd..240e0d61 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Queries.m @@ -303,6 +303,8 @@ - (void)fetchSleepCategorySamplesForPredicate:(NSPredicate *)predicate NSDictionary *elem = @{ @"value" : valueString, + @"sourceName" : [[[sample sourceRevision] source] name], + @"sourceId" : [[[sample sourceRevision] source] bundleIdentifier], @"startDate" : startDateString, @"endDate" : endDateString, }; diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m b/RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m index 727f05dc..483b3022 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m @@ -80,7 +80,7 @@ - (nullable HKObjectType *)getReadPermFromText:(nonnull NSString*)key { // Sleep if ([@"SleepAnalysis" isEqualToString: key]) { - return [HKObjectType quantityTypeForIdentifier:HKCategoryTypeIdentifierSleepAnalysis]; + return [HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierSleepAnalysis]; } // workouts