From 8c57616d2d9dda1e617c11fc7c5724698bc4889b Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Sun, 6 Nov 2016 17:11:59 -0500 Subject: [PATCH] removing sleep category files to readd and fix project issue --- RCTAppleHealthKit.xcodeproj/project.pbxproj | 6 --- .../RCTAppleHealthKit+Methods_Sleep.h | 15 ------ .../RCTAppleHealthKit+Methods_Sleep.m | 46 ------------------- .../ios/StepsDemo.xcodeproj/project.pbxproj | 28 +++++++++++ 4 files changed, 28 insertions(+), 67 deletions(-) delete mode 100644 RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h delete mode 100644 RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m diff --git a/RCTAppleHealthKit.xcodeproj/project.pbxproj b/RCTAppleHealthKit.xcodeproj/project.pbxproj index 0422dea..81f6100 100644 --- a/RCTAppleHealthKit.xcodeproj/project.pbxproj +++ b/RCTAppleHealthKit.xcodeproj/project.pbxproj @@ -15,7 +15,6 @@ 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 */; }; - 37837E121DCFCD0B000201A0 /* RCTAppleHealthKit+Methods_Sleep.m in Sources */ = {isa = PBXBuildFile; fileRef = 37837E111DCFCD0B000201A0 /* 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 */ @@ -49,8 +48,6 @@ 3774C8D61D20C65F0000B3F3 /* RCTAppleHealthKit+Methods_Fitness.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Fitness.m"; sourceTree = ""; }; 377D44F11D247D0A004E35CB /* RCTAppleHealthKit+Methods_Characteristic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Characteristic.h"; sourceTree = ""; }; 377D44F21D247D0A004E35CB /* RCTAppleHealthKit+Methods_Characteristic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Characteristic.m"; sourceTree = ""; }; - 37837E101DCFCD0B000201A0 /* RCTAppleHealthKit+Methods_Sleep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Sleep.h"; sourceTree = ""; }; - 37837E111DCFCD0B000201A0 /* RCTAppleHealthKit+Methods_Sleep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Sleep.m"; sourceTree = ""; }; 64C42D481D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Vitals.h"; sourceTree = ""; }; 64C42D491D351A8800A0A8F7 /* RCTAppleHealthKit+Methods_Vitals.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RCTAppleHealthKit+Methods_Vitals.m"; sourceTree = ""; }; 64E0E73D1D37947B00EAB905 /* RCTAppleHealthKit+Methods_Results.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RCTAppleHealthKit+Methods_Results.h"; sourceTree = ""; }; @@ -105,8 +102,6 @@ 3774C8D61D20C65F0000B3F3 /* RCTAppleHealthKit+Methods_Fitness.m */, 377D44F11D247D0A004E35CB /* RCTAppleHealthKit+Methods_Characteristic.h */, 377D44F21D247D0A004E35CB /* RCTAppleHealthKit+Methods_Characteristic.m */, - 37837E101DCFCD0B000201A0 /* RCTAppleHealthKit+Methods_Sleep.h */, - 37837E111DCFCD0B000201A0 /* RCTAppleHealthKit+Methods_Sleep.m */, ); path = RCTAppleHealthKit; sourceTree = ""; @@ -169,7 +164,6 @@ files = ( 3774C89B1D2095450000B3F3 /* RCTAppleHealthKit+Queries.m in Sources */, 3774C8A11D20A6B90000B3F3 /* RCTAppleHealthKit+Utils.m in Sources */, - 37837E121DCFCD0B000201A0 /* 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 */, diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h deleted file mode 100644 index 3afd6d9..0000000 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// 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 diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m deleted file mode 100644 index 02a7f54..0000000 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Sleep.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// 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 diff --git a/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj b/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj index 95529eb..f0b636c 100644 --- a/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj +++ b/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj @@ -90,6 +90,13 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 37837E761DCFE109000201A0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 37837E721DCFE109000201A0 /* RCTAppleHealthKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3774C88D1D2092F20000B3F3; + remoteInfo = RCTAppleHealthKit; + }; 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; @@ -126,6 +133,7 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = StepsDemo/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = StepsDemo/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 37837E721DCFE109000201A0 /* RCTAppleHealthKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAppleHealthKit.xcodeproj; path = "../node_modules/react-native-apple-healthkit/RCTAppleHealthKit.xcodeproj"; sourceTree = ""; }; 378616B51D257B040027C300 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 378616B71D257B040027C300 /* StepsDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = StepsDemo.entitlements; path = StepsDemo/StepsDemo.entitlements; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; @@ -258,6 +266,14 @@ name = Products; sourceTree = ""; }; + 37837E731DCFE109000201A0 /* Products */ = { + isa = PBXGroup; + children = ( + 37837E771DCFE109000201A0 /* libRCTAppleHealthKit.a */, + ); + name = Products; + sourceTree = ""; + }; 78C398B11ACF4ADC00677621 /* Products */ = { isa = PBXGroup; children = ( @@ -269,6 +285,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 37837E721DCFE109000201A0 /* RCTAppleHealthKit.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, @@ -391,6 +408,10 @@ ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; }, + { + ProductGroup = 37837E731DCFE109000201A0 /* Products */; + ProjectRef = 37837E721DCFE109000201A0 /* RCTAppleHealthKit.xcodeproj */; + }, { ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; @@ -493,6 +514,13 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 37837E771DCFE109000201A0 /* libRCTAppleHealthKit.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTAppleHealthKit.a; + remoteRef = 37837E761DCFE109000201A0 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; -- 2.26.2