From ad2e4eac7d42caf1f67117a559abfd74163ad74d Mon Sep 17 00:00:00 2001 From: Furyou81 Date: Thu, 31 Jan 2019 12:30:18 +0700 Subject: [PATCH] adding period for all --- RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m index 38fb9ae..d44926c 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m @@ -220,6 +220,7 @@ BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; + NSUInteger period = [RCTAppleHealthKit uintFromOptions:input key:@"period" withDefault:60]; if(startDate == nil){ callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]); return; @@ -229,6 +230,7 @@ [self fetchCumulativeSumStatisticsCollection:quantityType unit:unit + period:period startDate:startDate endDate:endDate ascending:ascending @@ -250,6 +252,7 @@ BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; + NSUInteger period = [RCTAppleHealthKit uintFromOptions:input key:@"period" withDefault:60]; if(startDate == nil){ callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]); return; @@ -259,6 +262,7 @@ [self fetchCumulativeSumStatisticsCollection:quantityType unit:unit + period:period startDate:startDate endDate:endDate ascending:ascending @@ -304,6 +308,7 @@ BOOL ascending = [RCTAppleHealthKit boolFromOptions:input key:@"ascending" withDefault:false]; NSDate *startDate = [RCTAppleHealthKit dateFromOptions:input key:@"startDate" withDefault:nil]; NSDate *endDate = [RCTAppleHealthKit dateFromOptions:input key:@"endDate" withDefault:[NSDate date]]; + NSUInteger period = [RCTAppleHealthKit uintFromOptions:input key:@"period" withDefault:60]; if(startDate == nil){ callback(@[RCTMakeError(@"startDate is required in options", nil, nil)]); return; @@ -313,6 +318,7 @@ [self fetchCumulativeSumStatisticsCollection:quantityType unit:unit + period:period startDate:startDate endDate:endDate ascending:ascending -- 2.26.2