Commit 1faa9791 authored by Greg Wilson's avatar Greg Wilson

standardizing naming and return objects

parent 62fbdfdf
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
@interface RCTAppleHealthKit (Methods_Fitness) @interface RCTAppleHealthKit (Methods_Fitness)
- (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_getStepCountOnDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;
- (void)fitness_getDailyStepCounts:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; - (void)fitness_getDailyStepCounts:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;
- (void)fitness_getDailyStepSamples:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; - (void)fitness_getDailyStepSamples:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
} }
- (void)fitness_getStepCountForDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback - (void)fitness_getStepCountOnDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback
{ {
NSDate *date = [RCTAppleHealthKit dateFromOptions:input key:@"date" withDefault:[NSDate date]]; NSDate *date = [RCTAppleHealthKit dateFromOptions:input key:@"date" withDefault:[NSDate date]];
......
...@@ -94,22 +94,22 @@ RCT_EXPORT_METHOD(getLatestLeanBodyMass:(NSDictionary *)input callback:(RCTRespo ...@@ -94,22 +94,22 @@ RCT_EXPORT_METHOD(getLatestLeanBodyMass:(NSDictionary *)input callback:(RCTRespo
} }
RCT_EXPORT_METHOD(getStepCountForToday:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) //RCT_EXPORT_METHOD(getStepCountForToday:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback)
{ //{
[self fitness_getStepCountForToday:input callback:callback]; // [self fitness_getStepCountForToday:input callback:callback];
} //}
RCT_EXPORT_METHOD(getStepCountForDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) RCT_EXPORT_METHOD(getStepCount:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback)
{ {
[self fitness_getStepCountForDay:input callback:callback]; [self fitness_getStepCountOnDay:input callback:callback];
} }
RCT_EXPORT_METHOD(getMultiDayStepCounts:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) //RCT_EXPORT_METHOD(getMultiDayStepCounts:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback)
{ //{
[self fitness_getDailyStepCounts:input callback:callback]; // [self fitness_getDailyStepCounts:input callback:callback];
} //}
RCT_EXPORT_METHOD(getDailyStepSamples:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) RCT_EXPORT_METHOD(getDailyStepCountSamples:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback)
{ {
[self fitness_getDailyStepSamples:input callback:callback]; [self fitness_getDailyStepSamples:input callback:callback];
} }
......
...@@ -21,8 +21,9 @@ A React Native bridge module for interacting with [Apple HealthKit] data. ...@@ -21,8 +21,9 @@ A React Native bridge module for interacting with [Apple HealthKit] data.
* [initHealthKit](#inithealthkit) * [initHealthKit](#inithealthkit)
* [getBiologicalSex](#getbiologicalsex) * [getBiologicalSex](#getbiologicalsex)
* [getDateOfBirth](#getdateofbirth) * [getDateOfBirth](#getdateofbirth)
* [getStepCountForToday](#getstepcountfortoday) * ~~[getStepCountForToday](#getstepcountfortoday)~~
* [getStepCountForDay](#getstepcountforday) * ~~[getStepCountForDay](#getstepcountforday)~~
* [getStepCount]
* [getMultiDayStepCounts](#getmultidaystepcounts) * [getMultiDayStepCounts](#getmultidaystepcounts)
* [getDistanceWalkingRunning](#getdistancewalkingrunning) * [getDistanceWalkingRunning](#getdistancewalkingrunning)
* [getDistanceCycling](#getdistancecycling) * [getDistanceCycling](#getdistancecycling)
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
* on the same Wi-Fi network. * on the same Wi-Fi network.
*/ */
// jsCodeLocation = [NSURL URLWithString:@"http://192.168.0.14:8081/index.ios.bundle?platform=ios&dev=true"]; jsCodeLocation = [NSURL URLWithString:@"http://192.168.0.14:8081/index.ios.bundle?platform=ios&dev=true"];
jsCodeLocation = [NSURL URLWithString:@"http://10.1.14.163:8081/index.ios.bundle?platform=ios&dev=true"]; // jsCodeLocation = [NSURL URLWithString:@"http://10.1.14.163:8081/index.ios.bundle?platform=ios&dev=true"];
/** /**
* OPTION 2 * OPTION 2
* Load from pre-bundled file on disk. The static bundle is automatically * Load from pre-bundled file on disk. The static bundle is automatically
......
...@@ -87,8 +87,8 @@ class Home extends Component { ...@@ -87,8 +87,8 @@ class Home extends Component {
* @private * @private
*/ */
_fetchStepsToday() { _fetchStepsToday() {
AppleHealthKit.getStepCountForToday(null, (err, steps) => { AppleHealthKit.getStepCount(null, (err, steps) => {
if(this._handleHKError(err, 'getStepCountForToday')){ if(this._handleHKError(err, 'getStepCount')){
return; return;
} }
this.setState({stepsToday: steps}); this.setState({stepsToday: steps});
...@@ -104,8 +104,8 @@ class Home extends Component { ...@@ -104,8 +104,8 @@ class Home extends Component {
let options = { let options = {
startDate: (new Date(2016,4,1)).toISOString(), startDate: (new Date(2016,4,1)).toISOString(),
}; };
AppleHealthKit.getDailyStepSamples(options, (err, res) => { AppleHealthKit.getDailyStepCountSamples(options, (err, res) => {
if(this._handleHKError(err, 'getDailyStepSamples')){ if(this._handleHKError(err, 'getDailyStepCountSamples')){
return; return;
} }
this.setState({stepHistory: res}); this.setState({stepHistory: res});
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
378616B61D257B040027C300 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378616B51D257B040027C300 /* HealthKit.framework */; }; 378616B61D257B040027C300 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378616B51D257B040027C300 /* HealthKit.framework */; };
379EEE991D286FEF0062AF55 /* libRCTAppleHealthKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 379EEE981D286FE80062AF55 /* libRCTAppleHealthKit.a */; }; 378DCB461D3158A800E83D06 /* libRCTAppleHealthKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 378DCB451D31589600E83D06 /* libRCTAppleHealthKit.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -91,9 +91,9 @@ ...@@ -91,9 +91,9 @@
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
remoteInfo = React; remoteInfo = React;
}; };
379EEE971D286FE80062AF55 /* PBXContainerItemProxy */ = { 378DCB441D31589600E83D06 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy; isa = PBXContainerItemProxy;
containerPortal = 379EEE931D286FE80062AF55 /* RCTAppleHealthKit.xcodeproj */; containerPortal = 378DCB401D31589600E83D06 /* RCTAppleHealthKit.xcodeproj */;
proxyType = 2; proxyType = 2;
remoteGlobalIDString = 3774C88D1D2092F20000B3F3; remoteGlobalIDString = 3774C88D1D2092F20000B3F3;
remoteInfo = RCTAppleHealthKit; remoteInfo = RCTAppleHealthKit;
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
378616B51D257B040027C300 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 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 = "<group>"; }; 378616B71D257B040027C300 /* StepsDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = StepsDemo.entitlements; path = StepsDemo/StepsDemo.entitlements; sourceTree = "<group>"; };
379EEE931D286FE80062AF55 /* RCTAppleHealthKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAppleHealthKit.xcodeproj; path = "../node_modules/react-native-apple-healthkit/RCTAppleHealthKit.xcodeproj"; sourceTree = "<group>"; }; 378DCB401D31589600E83D06 /* RCTAppleHealthKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAppleHealthKit.xcodeproj; path = "../node_modules/react-native-apple-healthkit/RCTAppleHealthKit.xcodeproj"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
379EEE991D286FEF0062AF55 /* libRCTAppleHealthKit.a in Frameworks */, 378DCB461D3158A800E83D06 /* libRCTAppleHealthKit.a in Frameworks */,
146834051AC3E58100842450 /* libReact.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
378616B61D257B040027C300 /* HealthKit.framework in Frameworks */, 378616B61D257B040027C300 /* HealthKit.framework in Frameworks */,
...@@ -268,10 +268,10 @@ ...@@ -268,10 +268,10 @@
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
379EEE941D286FE80062AF55 /* Products */ = { 378DCB411D31589600E83D06 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
379EEE981D286FE80062AF55 /* libRCTAppleHealthKit.a */, 378DCB451D31589600E83D06 /* libRCTAppleHealthKit.a */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = { 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
379EEE931D286FE80062AF55 /* RCTAppleHealthKit.xcodeproj */, 378DCB401D31589600E83D06 /* RCTAppleHealthKit.xcodeproj */,
146833FF1AC3E56700842450 /* React.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */,
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
...@@ -411,8 +411,8 @@ ...@@ -411,8 +411,8 @@
ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
}, },
{ {
ProductGroup = 379EEE941D286FE80062AF55 /* Products */; ProductGroup = 378DCB411D31589600E83D06 /* Products */;
ProjectRef = 379EEE931D286FE80062AF55 /* RCTAppleHealthKit.xcodeproj */; ProjectRef = 378DCB401D31589600E83D06 /* RCTAppleHealthKit.xcodeproj */;
}, },
{ {
ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
...@@ -516,11 +516,11 @@ ...@@ -516,11 +516,11 @@
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR; sourceTree = BUILT_PRODUCTS_DIR;
}; };
379EEE981D286FE80062AF55 /* libRCTAppleHealthKit.a */ = { 378DCB451D31589600E83D06 /* libRCTAppleHealthKit.a */ = {
isa = PBXReferenceProxy; isa = PBXReferenceProxy;
fileType = archive.ar; fileType = archive.ar;
path = libRCTAppleHealthKit.a; path = libRCTAppleHealthKit.a;
remoteRef = 379EEE971D286FE80062AF55 /* PBXContainerItemProxy */; remoteRef = 378DCB441D31589600E83D06 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR; sourceTree = BUILT_PRODUCTS_DIR;
}; };
78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
* on the same Wi-Fi network. * on the same Wi-Fi network.
*/ */
// //
// jsCodeLocation = [NSURL URLWithString:@"http://192.168.0.14:8081/index.ios.bundle?platform=ios&dev=true"]; jsCodeLocation = [NSURL URLWithString:@"http://192.168.0.14:8081/index.ios.bundle?platform=ios&dev=true"];
jsCodeLocation = [NSURL URLWithString:@"http://10.1.14.163:8081/index.ios.bundle?platform=ios&dev=true"]; // jsCodeLocation = [NSURL URLWithString:@"http://10.1.14.163:8081/index.ios.bundle?platform=ios&dev=true"];
/** /**
* OPTION 2 * OPTION 2
* Load from pre-bundled file on disk. The static bundle is automatically * Load from pre-bundled file on disk. The static bundle is automatically
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment