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
d8309cc4
Commit
d8309cc4
authored
Jan 18, 2019
by
Furyou81
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter steps
parent
950fe096
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
+19
-3
No files found.
RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
View file @
d8309cc4
...
@@ -293,9 +293,12 @@
...
@@ -293,9 +293,12 @@
unit
:(
HKUnit
*
)
unit
unit
:(
HKUnit
*
)
unit
day
:(
NSDate
*
)
day
day
:(
NSDate
*
)
day
completion
:(
void
(
^
)(
double
,
NSDate
*
,
NSDate
*
,
NSError
*
))
completionHandler
{
completion
:(
void
(
^
)(
double
,
NSDate
*
,
NSDate
*
,
NSError
*
))
completionHandler
{
NSPredicate
*
predicate1
=
[
NSPredicate
predicateWithFormat
:
@"metadata.%K != YES"
,
HKMetadataKeyWasUserEntered
];
NSPredicate
*
predicate
=
[
RCTAppleHealthKit
predicateForSamplesOnDay
:
day
];
//NSPredicate *predicate =
HKStatisticsQuery
*
query
=
[[
HKStatisticsQuery
alloc
]
initWithQuantityType
:
quantityType
NSPredicate
*
predicate2
=
[
RCTAppleHealthKit
predicateForSamplesOnDay
:
day
];
NSPredicate
*
predicate
=
[
NSCompoundPredicate
andPredicateWithSubpredicates
:
@[
predicate1
,
predicate2
]];
HKStatisticsQuery
*
query
=
[[
HKStatisticsQuery
alloc
]
initWithQuantityType
:
quantityType
// predicate:p
quantitySamplePredicate:
predicate
quantitySamplePredicate:
predicate
options:
HKStatisticsOptionCumulativeSum
options:
HKStatisticsOptionCumulativeSum
completionHandler:
^
(
HKStatisticsQuery
*
query
,
HKStatistics
*
result
,
NSError
*
error
)
{
completionHandler:
^
(
HKStatisticsQuery
*
query
,
HKStatistics
*
result
,
NSError
*
error
)
{
...
@@ -303,6 +306,19 @@
...
@@ -303,6 +306,19 @@
NSDate
*
startDate
=
result
.
startDate
;
NSDate
*
startDate
=
result
.
startDate
;
NSDate
*
endDate
=
result
.
endDate
;
NSDate
*
endDate
=
result
.
endDate
;
if
(
completionHandler
)
{
if
(
completionHandler
)
{
printf
(
"HELOOOOOOOOOOOOOO"
);
NSLog
(
@"%@"
,
result
.
sources
);
for
(
HKSource
*
source
in
result
.
sources
)
{
printf
(
"%s"
,
source
.
bundleIdentifier
);
// if (![source.bundleIdentifier isEqualToString:@"com.apple.Health"])
// {
// [dataSources addObject:source];
// }
}
printf
(
"HELOOOOOOOOOOOOOO"
);
double
value
=
[
sum
doubleValueForUnit
:
unit
];
double
value
=
[
sum
doubleValueForUnit
:
unit
];
completionHandler
(
value
,
startDate
,
endDate
,
error
);
completionHandler
(
value
,
startDate
,
endDate
,
error
);
}
}
...
...
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