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
67679c39
Commit
67679c39
authored
Apr 25, 2019
by
Furyou81
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding a flag includeManuallyAdded
parent
ad2e4eac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m
+9
-0
RCTAppleHealthKit/RCTAppleHealthKit+Queries.h
RCTAppleHealthKit/RCTAppleHealthKit+Queries.h
+1
-0
RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
+5
-1
No files found.
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m
View file @
67679c39
...
...
@@ -104,6 +104,8 @@
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
];
BOOL
includeManuallyAdded
=
[
RCTAppleHealthKit
boolFromOptions
:
input
key
:
@"includeManuallyAdded"
withDefault
:
false
];
if
(
startDate
==
nil
){
callback
(@[
RCTMakeError
(
@"startDate is required in options"
,
nil
,
nil
)]);
return
;
...
...
@@ -118,6 +120,7 @@
endDate:
endDate
ascending:
ascending
limit:
limit
includeManuallyAdded:
includeManuallyAdded
completion:
^
(
NSArray
*
arr
,
NSError
*
err
){
if
(
err
!=
nil
)
{
NSLog
(
@"error with fetchCumulativeSumStatisticsCollection: %@"
,
err
);
...
...
@@ -221,6 +224,7 @@
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
];
BOOL
includeManuallyAdded
=
[
RCTAppleHealthKit
boolFromOptions
:
input
key
:
@"includeManuallyAdded"
withDefault
:
false
];
if
(
startDate
==
nil
){
callback
(@[
RCTMakeError
(
@"startDate is required in options"
,
nil
,
nil
)]);
return
;
...
...
@@ -235,6 +239,7 @@
endDate:
endDate
ascending:
ascending
limit:
limit
includeManuallyAdded:
includeManuallyAdded
completion:
^
(
NSArray
*
arr
,
NSError
*
err
){
if
(
err
!=
nil
)
{
NSLog
(
@"error with fetchCumulativeSumStatisticsCollection: %@"
,
err
);
...
...
@@ -253,6 +258,7 @@
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
];
BOOL
includeManuallyAdded
=
[
RCTAppleHealthKit
boolFromOptions
:
input
key
:
@"includeManuallyAdded"
withDefault
:
false
];
if
(
startDate
==
nil
){
callback
(@[
RCTMakeError
(
@"startDate is required in options"
,
nil
,
nil
)]);
return
;
...
...
@@ -267,6 +273,7 @@
endDate:
endDate
ascending:
ascending
limit:
limit
includeManuallyAdded:
includeManuallyAdded
completion:
^
(
NSArray
*
arr
,
NSError
*
err
){
if
(
err
!=
nil
)
{
NSLog
(
@"error with fetchCumulativeSumStatisticsCollection: %@"
,
err
);
...
...
@@ -309,6 +316,7 @@
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
];
BOOL
includeManuallyAdded
=
[
RCTAppleHealthKit
boolFromOptions
:
input
key
:
@"includeManuallyAdded"
withDefault
:
false
];
if
(
startDate
==
nil
){
callback
(@[
RCTMakeError
(
@"startDate is required in options"
,
nil
,
nil
)]);
return
;
...
...
@@ -323,6 +331,7 @@
endDate:
endDate
ascending:
ascending
limit:
limit
includeManuallyAdded:
includeManuallyAdded
completion:
^
(
NSArray
*
arr
,
NSError
*
err
){
if
(
err
!=
nil
)
{
NSLog
(
@"error with fetchCumulativeSumStatisticsCollection: %@"
,
err
);
...
...
RCTAppleHealthKit/RCTAppleHealthKit+Queries.h
View file @
67679c39
...
...
@@ -57,6 +57,7 @@
endDate
:(
NSDate
*
)
endDate
ascending
:(
BOOL
)
asc
limit
:(
NSUInteger
)
lim
includeManuallyAdded
:(
BOOL
)
includeManuallyAdded
completion
:(
void
(
^
)(
NSArray
*
,
NSError
*
))
completionHandler
;
...
...
RCTAppleHealthKit/RCTAppleHealthKit+Queries.m
View file @
67679c39
...
...
@@ -578,6 +578,7 @@
endDate
:(
NSDate
*
)
endDate
ascending
:(
BOOL
)
asc
limit
:(
NSUInteger
)
lim
includeManuallyAdded
:(
BOOL
)
includeManuallyAdded
completion
:(
void
(
^
)(
NSArray
*
,
NSError
*
))
completionHandler
{
NSCalendar
*
calendar
=
[
NSCalendar
currentCalendar
];
...
...
@@ -588,7 +589,10 @@
fromDate:
startDate
];
//anchorComponents.hour = 0;
NSDate
*
anchorDate
=
[
calendar
dateFromComponents
:
anchorComponents
];
NSPredicate
*
predicate
=
[
NSPredicate
predicateWithFormat
:
@"metadata.%K != YES"
,
HKMetadataKeyWasUserEntered
];
NSPredicate
*
predicate
=
nil
;
if
(
includeManuallyAdded
==
false
)
{
predicate
=
[
NSPredicate
predicateWithFormat
:
@"metadata.%K != YES"
,
HKMetadataKeyWasUserEntered
];
}
// Create the query
HKStatisticsCollectionQuery
*
query
=
[[
HKStatisticsCollectionQuery
alloc
]
initWithQuantityType
:
quantityType
quantitySamplePredicate:
predicate
...
...
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