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
7a9fd5ac
Commit
7a9fd5ac
authored
Nov 06, 2016
by
Greg Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added sleep category... again...
parent
8c57616d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
RCTAppleHealthKit.xcodeproj/project.pbxproj
RCTAppleHealthKit.xcodeproj/project.pbxproj
+6
-0
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h
+15
-0
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m
+47
-0
No files found.
RCTAppleHealthKit.xcodeproj/project.pbxproj
View file @
7a9fd5ac
...
...
@@ -15,6 +15,7 @@
3774C8D41D20C6390000B3F3
/* RCTAppleHealthKit+Methods_Body.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3774C8D31D20C6390000B3F3
/* RCTAppleHealthKit+Methods_Body.m */
;
};
3774C8D71D20C65F0000B3F3
/* RCTAppleHealthKit+Methods_Fitness.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3774C8D61D20C65F0000B3F3
/* RCTAppleHealthKit+Methods_Fitness.m */
;
};
377D44F31D247D0A004E35CB
/* RCTAppleHealthKit+Methods_Characteristic.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
377D44F21D247D0A004E35CB
/* RCTAppleHealthKit+Methods_Characteristic.m */
;
};
37837E7D1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
37837E7C1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.m */
;
};
64C42D4A1D351A8800A0A8F7
/* RCTAppleHealthKit+Methods_Vitals.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
64C42D491D351A8800A0A8F7
/* RCTAppleHealthKit+Methods_Vitals.m */
;
};
64E0E73F1D37947B00EAB905
/* RCTAppleHealthKit+Methods_Results.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
64E0E73E1D37947B00EAB905
/* RCTAppleHealthKit+Methods_Results.m */
;
};
/* End PBXBuildFile section */
...
...
@@ -48,6 +49,8 @@
3774C8D61D20C65F0000B3F3
/* RCTAppleHealthKit+Methods_Fitness.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"RCTAppleHealthKit+Methods_Fitness.m"
;
sourceTree
=
"<group>"
;
};
377D44F11D247D0A004E35CB
/* RCTAppleHealthKit+Methods_Characteristic.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"RCTAppleHealthKit+Methods_Characteristic.h"
;
sourceTree
=
"<group>"
;
};
377D44F21D247D0A004E35CB
/* RCTAppleHealthKit+Methods_Characteristic.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"RCTAppleHealthKit+Methods_Characteristic.m"
;
sourceTree
=
"<group>"
;
};
37837E7B1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"RCTAppleHealthKit+Methods_Sleep.h"
;
sourceTree
=
"<group>"
;
};
37837E7C1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"RCTAppleHealthKit+Methods_Sleep.m"
;
sourceTree
=
"<group>"
;
};
64C42D481D351A8800A0A8F7
/* RCTAppleHealthKit+Methods_Vitals.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"RCTAppleHealthKit+Methods_Vitals.h"
;
sourceTree
=
"<group>"
;
};
64C42D491D351A8800A0A8F7
/* RCTAppleHealthKit+Methods_Vitals.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"RCTAppleHealthKit+Methods_Vitals.m"
;
sourceTree
=
"<group>"
;
};
64E0E73D1D37947B00EAB905
/* RCTAppleHealthKit+Methods_Results.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"RCTAppleHealthKit+Methods_Results.h"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -102,6 +105,8 @@
3774C8D61D20C65F0000B3F3
/* RCTAppleHealthKit+Methods_Fitness.m */
,
377D44F11D247D0A004E35CB
/* RCTAppleHealthKit+Methods_Characteristic.h */
,
377D44F21D247D0A004E35CB
/* RCTAppleHealthKit+Methods_Characteristic.m */
,
37837E7B1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.h */
,
37837E7C1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.m */
,
);
path
=
RCTAppleHealthKit
;
sourceTree
=
"<group>"
;
...
...
@@ -164,6 +169,7 @@
files
=
(
3774C89B1D2095450000B3F3
/* RCTAppleHealthKit+Queries.m in Sources */
,
3774C8A11D20A6B90000B3F3
/* RCTAppleHealthKit+Utils.m in Sources */
,
37837E7D1DCFE270000201A0
/* RCTAppleHealthKit+Methods_Sleep.m in Sources */
,
3774C8D41D20C6390000B3F3
/* RCTAppleHealthKit+Methods_Body.m in Sources */
,
64E0E73F1D37947B00EAB905
/* RCTAppleHealthKit+Methods_Results.m in Sources */
,
64C42D4A1D351A8800A0A8F7
/* RCTAppleHealthKit+Methods_Vitals.m in Sources */
,
...
...
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h
0 → 100644
View file @
7a9fd5ac
//
// RCTAppleHealthKit+Methods_Sleep.h
// RCTAppleHealthKit
//
// Created by Greg Wilson on 2016-11-06.
// Copyright © 2016 Greg Wilson. All rights reserved.
//
#import "RCTAppleHealthKit.h"
@interface
RCTAppleHealthKit
(
Methods_Sleep
)
-
(
void
)
sleep_getSleepSamples
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
;
@end
RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m
0 → 100644
View file @
7a9fd5ac
//
// RCTAppleHealthKit+Methods_Sleep.m
// RCTAppleHealthKit
//
// Created by Greg Wilson on 2016-11-06.
// Copyright © 2016 Greg Wilson. All rights reserved.
//
#import "RCTAppleHealthKit+Methods_Sleep.h"
#import "RCTAppleHealthKit+Queries.h"
#import "RCTAppleHealthKit+Utils.h"
@implementation
RCTAppleHealthKit
(
Methods_Sleep
)
-
(
void
)
sleep_getSleepSamples
:(
NSDictionary
*
)
input
callback
:(
RCTResponseSenderBlock
)
callback
{
NSDate
*
startDate
=
[
RCTAppleHealthKit
dateFromOptions
:
input
key
:
@"startDate"
withDefault
:
nil
];
NSDate
*
endDate
=
[
RCTAppleHealthKit
dateFromOptions
:
input
key
:
@"endDate"
withDefault
:
[
NSDate
date
]];
if
(
startDate
==
nil
){
callback
(@[
RCTMakeError
(
@"startDate is required in options"
,
nil
,
nil
)]);
return
;
}
NSPredicate
*
predicate
=
[
RCTAppleHealthKit
predicateForSamplesBetweenDates
:
startDate
endDate
:
endDate
];
NSUInteger
limit
=
[
RCTAppleHealthKit
uintFromOptions
:
input
key
:
@"limit"
withDefault
:
HKObjectQueryNoLimit
];
[
self
fetchSleepCategorySamplesForPredicate
:
predicate
limit:
limit
completion:
^
(
NSArray
*
results
,
NSError
*
error
)
{
if
(
results
){
callback
(@[[
NSNull
null
],
results
]);
return
;
}
else
{
NSLog
(
@"error getting sleep samples: %@"
,
error
);
callback
(@[
RCTMakeError
(
@"error getting sleep samples"
,
nil
,
nil
)]);
return
;
}
}];
}
@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