Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rn-apple-healthkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ym
rn-apple-healthkit
Commits
ebdf34f8
Commit
ebdf34f8
authored
Jun 28, 2016
by
Greg Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added fitness_getDailyStepCounts method
parent
5f75fab5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h
+2
-0
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m
+27
-0
No files found.
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h
View file @
ebdf34f8
...
@@ -13,4 +13,6 @@
...
@@ -13,4 +13,6 @@
-
(
void
)
fitness_getStepCountForToday
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
-
(
void
)
fitness_getStepCountForToday
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
-
(
void
)
fitness_getStepCountForDay
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
-
(
void
)
fitness_getStepCountForDay
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
-
(
void
)
fitness_getDailyStepCounts
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
@end
@end
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m
View file @
ebdf34f8
...
@@ -51,4 +51,31 @@
...
@@ -51,4 +51,31 @@
}
}
-
(
void
)
fitness_getDailyStepCounts
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
{
NSDate
*
startDate
=
[
RCTAppleHealthKit
startDateFromOptions
:
input
];
NSDate
*
endDate
=
[
RCTAppleHealthKit
endDateFromOptionsDefaultNow
:
input
];
if
(
startDate
==
nil
)
{
callback
(@[
RCTMakeError
(
@"could not parse required startDate from options.startDate"
,
nil
,
nil
)]);
return
;
}
HKQuantityType
*
stepCountType
=
[
HKObjectType
quantityTypeForIdentifier
:
HKQuantityTypeIdentifierStepCount
];
HKUnit
*
stepsUnit
=
[
HKUnit
countUnit
];
[
self
fetchCumulativeSumStatisticsCollection
:
stepCountType
unit
:
stepsUnit
startDate
:
startDate
endDate
:
endDate
completion
:^
(
NSArray
*
arr
,
NSError
*
err
){
if
(
err
!=
nil
)
{
NSLog
(
@"error with fetchCumulativeSumStatisticsCollection: %@"
,
err
);
callback
(@[
RCTMakeError
(
@"error with fetchCumulativeSumStatisticsCollection"
,
err
,
nil
)]);
return
;
}
callback
(@[[
NSNull
null
],
arr
]);
}];
}
@end
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment