Skip to content

Commit

Permalink
Fixed sleep permission request not working (#132)
Browse files Browse the repository at this point in the history
* Fixed sleep permission request not working
Solves #125

* Added source to getSleepSamples result objects
Fixes #133
  • Loading branch information
dmatora authored and terrillo committed Jan 21, 2020
1 parent 8e8949f commit daaffab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion RCTAppleHealthKit/RCTAppleHealthKit+TypesAndPermissions.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ - (nullable HKObjectType *)getReadPermFromText:(nonnull NSString*)key {

// Sleep
if ([@"SleepAnalysis" isEqualToString: key]) {
return [HKObjectType quantityTypeForIdentifier:HKCategoryTypeIdentifierSleepAnalysis];
return [HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierSleepAnalysis];
}

// workouts
Expand Down

0 comments on commit daaffab

Please sign in to comment.