diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h index 3a859b0354f78ed7d5d089bbfc61711d5e1c4a49..a396875d511f446bce74c1d3c9c0ee19625de78b 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.h @@ -18,6 +18,8 @@ - (void)fitness_saveSteps:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; +- (void)fitness_initializeStepEventObserver:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; + - (void)fitness_getDistanceWalkingRunningOnDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; - (void)fitness_getDistanceCyclingOnDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; - (void)fitness_getFlightsClimbedOnDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; diff --git a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m index f885df4b2e15545fb83922c1c5eff7bee0c27477..3b5ae887b7d0e3d6e01e549fe7214771dbafa502 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit+Methods_Fitness.m @@ -10,8 +10,12 @@ #import "RCTAppleHealthKit+Queries.h" #import "RCTAppleHealthKit+Utils.h" +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" + @implementation RCTAppleHealthKit (Methods_Fitness) + //- (void)fitness_getStepCountForToday:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback //{ // HKQuantityType *stepCountType = [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]; @@ -156,6 +160,38 @@ +- (void)fitness_initializeStepEventObserver:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback +{ + HKSampleType *sampleType = + [HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierStepCount]; + + HKObserverQuery *query = + [[HKObserverQuery alloc] + initWithSampleType:sampleType + predicate:nil + updateHandler:^(HKObserverQuery *query, + HKObserverQueryCompletionHandler completionHandler, + NSError *error) { + + if (error) { + // Perform Proper Error Handling Here... + NSLog(@"*** An error occured while setting up the stepCount observer. %@ ***", error.localizedDescription); + callback(@[RCTMakeError(@"An error occured while setting up the stepCount observer", error, nil)]); + return; + } + + [self.bridge.eventDispatcher sendAppEventWithName:@"change:steps" + body:@{@"name": @"change:steps"}]; + + // If you have subscribed for background updates you must call the completion handler here. + // completionHandler(); + + }]; + + [self.healthStore executeQuery:query]; +} + + - (void)fitness_getDistanceWalkingRunningOnDay:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback { diff --git a/RCTAppleHealthKit/RCTAppleHealthKit.m b/RCTAppleHealthKit/RCTAppleHealthKit.m index f016e75b7f0045f07e3f40603024b1e8b498131c..036881b55656c64aea88b668cb913e0944653707 100644 --- a/RCTAppleHealthKit/RCTAppleHealthKit.m +++ b/RCTAppleHealthKit/RCTAppleHealthKit.m @@ -17,8 +17,14 @@ #import "RCTAppleHealthKit+Methods_Vitals.h" #import "RCTAppleHealthKit+Methods_Results.h" +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" + @implementation RCTAppleHealthKit +@synthesize bridge = _bridge; + + RCT_EXPORT_MODULE(); @@ -32,6 +38,11 @@ RCT_EXPORT_METHOD(initHealthKit:(NSDictionary *)input callback:(RCTResponseSende [self initializeHealthKit:input callback:callback]; } +RCT_EXPORT_METHOD(initStepCountObserver:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) +{ + [self fitness_initializeStepEventObserver:input callback:callback]; +} + RCT_EXPORT_METHOD(getBiologicalSex:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) { [self characteristic_getBiologicalSex:input callback:callback]; @@ -181,7 +192,7 @@ RCT_EXPORT_METHOD(getInfo:(NSDictionary *)input callback:(RCTResponseSenderBlock - (void)initializeHealthKit:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback { self.healthStore = [[HKHealthStore alloc] init]; - + if ([HKHealthStore isHealthDataAvailable]) { NSSet *writeDataTypes; NSSet *readDataTypes; @@ -193,7 +204,7 @@ RCT_EXPORT_METHOD(getInfo:(NSDictionary *)input callback:(RCTResponseSenderBlock NSArray* writePermsArray = [permissions objectForKey:@"write"]; NSSet* readPerms = [self getReadPermsFromOptions:readPermsArray]; NSSet* writePerms = [self getWritePermsFromOptions:writePermsArray]; - + if(readPerms != nil) { readDataTypes = readPerms; } diff --git a/README.md b/README.md index 506ab9ec50d7cb50857bbff1a615fa4f58be7689..663de17990c9a1ad7cdef90384e85d6859e18f7c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # react-native-apple-healthkit -A React Native bridge module for interacting with [Apple HealthKit] data. +A React Native bridge module for interacting with [Apple HealthKit] data. ![Alt text](https://devimages.apple.com.edgekey.net/assets/elements/icons/healthkit/healthkit-64x64.png "Apple HealthKit") @@ -20,10 +20,8 @@ A React Native bridge module for interacting with [Apple HealthKit] data. * [getBiologicalSex](#getbiologicalsex) * [getDateOfBirth](#getdateofbirth) * [getStepCount](#getstepcount) - * ~~[getStepCountForToday](#getstepcountfortoday)~~ - * ~~[getStepCountForDay](#getstepcountforday)~~ * [getDailyStepCountSamples](#getdailystepcountsamples) - * ~~[getMultiDayStepCounts](#getmultidaystepcounts)~~ + * [initStepCountObserver](#initstepcountobserver) * [saveSteps](#savesteps) * [getDistanceWalkingRunning](#getdistancewalkingrunning) * [getDistanceCycling](#getdistancecycling) @@ -44,7 +42,7 @@ A React Native bridge module for interacting with [Apple HealthKit] data. * [getRespiratoryRateSamples](#getrespiratoryratesamples) * [getBloodGlucoseSamples](#getbloodglucosesamples) * [Examples](#examples) - + ## Getting started @@ -55,7 +53,7 @@ Install the [react-native-apple-healthkit] package from npm: `npm install react-native-apple-healthkit --save` ##### Xcode - + 1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` 2. Go to `node_modules` ➜ `react-native-apple-healthkit` and add `RCTAppleHealthKit.xcodeproj` 3. In XCode, in the project navigator, select your project. Add `libRCTAppleHealthKit.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` @@ -128,7 +126,7 @@ AppleHealthKit.saveWeight(options: Object, (err: Object, res: Object) => { Permissions ----------- -The available HealthKit permissions to use with `initHealthKit` +The available HealthKit permissions to use with `initHealthKit` | Permission | HealthKit Identifier Type | Read | Write | |------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|------|-------| @@ -190,7 +188,7 @@ Options Methods ------- -#### **`isAvailable`** +#### **`isAvailable`** Check if HealthKit is available on the device. ```javascript AppleHealthKit.isAvailable((err: Object, available: boolean) => { @@ -201,10 +199,10 @@ AppleHealthKit.isAvailable((err: Object, available: boolean) => { ``` ___ -#### **`initHealthKit`** -Initialize HealthKit. This will show the HealthKit permissions prompt for any read/write permissions set in the required `options` object. +#### **`initHealthKit`** +Initialize HealthKit. This will show the HealthKit permissions prompt for any read/write permissions set in the required `options` object. -Due to Apple's privacy model if an app user has previously denied a specific permission then they can not be prompted again for that same permission. The app user would have to go into the Apple Health app and grant the permission to your react-native app under *sources* tab. +Due to Apple's privacy model if an app user has previously denied a specific permission then they can not be prompted again for that same permission. The app user would have to go into the Apple Health app and grant the permission to your react-native app under *sources* tab. For any data that is read from HealthKit the status/error is the same for both. This privacy restriction results in having no knowledge of whether the permission was denied (make sure it's added to the permissions options object), or the data for the specific request was nil (ex. no steps recorded today). @@ -262,9 +260,9 @@ Get the date of birth. On success, the callback function will be provided with a `res` object containing dob `value: string` (ISO timestamp), and `age: number` (age in years): ```javascript -{ - value: '1986-09-01T00:00:00.000-0400', - age: 29 +{ + value: '1986-09-01T00:00:00.000-0400', + age: 29 } ``` @@ -281,9 +279,9 @@ AppleHealthKit.getDateOfBirth(null, (err: Object, res: Object) => { ___ #### **`getStepCount`** -Get the aggregated total steps for a specific day (starting and ending at midnight). +Get the aggregated total steps for a specific day (starting and ending at midnight). -An optional options object may be provided containing `date` field representing the selected day. If `date` is not set or an options object is not provided then the current day will be used. +An optional options object may be provided containing `date` field representing the selected day. If `date` is not set or an options object is not provided then the current day will be used. ```javascript let d = new Date(2016,5,27); let options = { @@ -302,42 +300,8 @@ AppleHealthKit.getStepCount(options: Object, (err: Object, steps: Object) => { ___ -#### ~~**`getStepCountForToday`**~~ -**removed** - replaced by `getStepCount` - -get the aggregated total steps for the current day starting and ending at midnight -```javascript -AppleHealthKit.getStepCountForToday(null, (err: Object, steps: number) => { - if(this._handleHealthKitError(err, 'getStepCountForToday')){ - return; - } - // use steps... -}); -``` - -___ - -#### ~~**`getStepCountForDay`**~~ -**removed** - replaced by `getStepCount` - -get the the aggregated total steps for the day provided as `date` in options object. the `date` field expects an ISO date string as its value -```javascript -let d = new Date(2016,5,27); -let options = { - date: d.toISOString() -}; -AppleHealthKit.getStepCountForDay(options: Object, (err: Object, steps: number) => { - if(this._handleHealthKitError(err, 'getStepCountForDay')){ - return; - } - // steps is the step count for day 'd' -}); -``` - -___ - #### **`getDailyStepCountSamples`** -Get the total steps per day over a specified date range. +Get the total steps per day over a specified date range. `getDailyStepCountSamples` accepts an options object containing required *`startDate: ISO8601Timestamp`* and optional *`endDate: ISO8601Timestamp`*. If `endDate` is not provided it will default to the current time ```javascript @@ -348,7 +312,7 @@ let options = { ``` The function will be called with an array of elements. Each element is an object containing `value`, `startDate`, and `endDate` fields: ```javascript -[ +[ { value: 8, startDate: '2016-07-09T00:00:00.000-0400', endDate: '2016-07-10T00:00:00.000-0400' }, { value: 1923, startDate: '2016-07-08T00:00:00.000-0400', endDate: '2016-07-09T00:00:00.000-0400' }, { value: 1802, startDate: '2016-07-07T00:00:00.000-0400', endDate: '2016-07-08T00:00:00.000-0400' }, @@ -375,32 +339,69 @@ The function will be called with an array of elements. Each element is an object ___ -#### ~~**`getMultiDayStepCounts`**~~ -**removed** - replaced by `getDailyStepCountSamples` +#### **`initStepCountObserver`** +Setup an HKObserverQuery for step count (HKQuantityTypeIdentifierStepCount) that will +trigger an event listenable on react-native `NativeAppEventEmitter` when the +HealthKit step count has changed. -Get the total steps per day over a specified date range. +The `initStepCountObserver` method must be called before adding a listener to +NativeAppEventEmitter. After the step count observer has been initialized you can +listen to the NativeAppEventEmitter `change:steps` event and re-fetch relevent +step count data in the event handler. + +The `initStepCountObserver` method should be called after HealthKit has been +successfully initialized (AppleHealthKit.initHealthKit has been called without +error). -`getMultiDayStepCounts` accepts an options object containing required *`startDate: ISO8601Timestamp`* and optional *`endDate: ISO8601Timestamp`*. if `endDate` is not provided it will default to the current time -```javascript -let options = { - startDate: (new Date(2016,5,1)).toISOString() // required - endDate: (new Date()).toISOString() // optional; default now -}; -``` -the function will be called with an array of elements `res` containing date and step count information ```javascript - AppleHealthKit.getMultiDayStepCounts(options: Object, (err: Object, res: Array>) => { - if(this._handleHealthKitError(err, 'getMultiDayStepCounts')){ - return; - } - // 'res' is array of [ISOTimestamp: string, stepCount: number] arrays - // sorted ascending from startDate through endDate - for(let i=0; i { + if(this._handleHKError(err, 'initHealthKit')){ + return; + } + + // initialize the step count observer + AppleHealthKit.initStepCountObserver({}, () => {}); + + // add event listener for 'change:steps' and handle the + // event in the event handler function. + // + // when adding a listener, a 'subscription' object is + // returned that must be used to remove the listener + // when the component unmounts. The subscription object + // must be accessible to any function/method/instance + // that will be unsubscribing from the event. + this.sub = NativeAppEventEmitter.addListener( + 'change:steps', + (evt) => { + // a 'change:steps' event has been received. step + // count data should be re-fetched from HealthKit. + this._fetchStepCountData(); } + ); + ... }); + +... + +// when the component where the listener was added unmounts +// (or whenever the listener should be removed), call the +// `remove` method of the subscription object. +componentWillUnmount() { + this.sub.remove(); +} ``` ___ @@ -412,7 +413,7 @@ A step count sample represents the number of steps during a specific period of t `saveSteps` accepts an options object containing required *`value: number`*, *`startDate: ISO8601Timestamp`*, and *`endDate: ISO8601Timestamp`*. ```javascript -// startDate and endDate are 30 minutes apart. +// startDate and endDate are 30 minutes apart. // this means the step count value occured within those 30 minutes. let options = { value: 100, @@ -423,7 +424,7 @@ let options = { ```javascript AppleHealthKit.saveSteps(options, (err, res) => { - if(this._handleHKError(err, 'saveSteps')){ + if(this._handleHKError(err, 'saveSteps')){ return; } // step count sample successfully saved @@ -433,7 +434,7 @@ AppleHealthKit.saveSteps(options, (err, res) => { ___ #### **`getDistanceWalkingRunning`** -Get the total distance walking/running on a specific day. +Get the total distance walking/running on a specific day. `getDistanceWalkingRunning` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter`. ```javascript @@ -455,7 +456,7 @@ AppleHealthKit.getDistanceWalkingRunning(options: Object, (err: Object, res: Obj ___ #### **`getDistanceCycling`** -Get the total distance cycling on a specific day. +Get the total distance cycling on a specific day. `getDistanceCycling` accepts an options object containing optional *`date: ISO8601Timestamp`* and *`unit: string`*. If `date` is not provided it will default to the current time. `unit` defaults to `meter` ```javascript @@ -477,7 +478,7 @@ AppleHealthKit.getDistanceCycling(options: Object, (err: Object, res: Object) => ___ #### **`getFlightsClimbed`** -get the total flights climbed (1 flight is ~10ft of elevation) on a specific day. +get the total flights climbed (1 flight is ~10ft of elevation) on a specific day. `getFlightsClimbed` accepts an options object containing optional *`date: ISO8601Timestamp`*. if `date` is not provided it will default to the current time. ```javascript @@ -504,7 +505,7 @@ On success, the callback function will be provided with a `weight` object contai ```javascript { value: 200, - startDate: '2016-07-08T12:00:00.000-0400', + startDate: '2016-07-08T12:00:00.000-0400', endDate: '2016-07-08T12:00:00.000-0400' } ``` @@ -570,7 +571,7 @@ On success, the callback function will be provided with a `height` object contai ```javascript { value: 72, - startDate: '2016-07-08T12:00:00.000-0400', + startDate: '2016-07-08T12:00:00.000-0400', endDate: '2016-07-08T12:00:00.000-0400' } ``` @@ -640,13 +641,13 @@ AppleHealthKit.saveHeight(options: Object, (err: Object, res: Object) => { ___ #### **`getLatestBmi`** -Get the most recent BMI sample. +Get the most recent BMI sample. On success, the callback function will be provided with a `bmi` object containing the BMI `value`, and the `startDate` and `endDate` of the sample. *Note: startDate and endDate will be the same as bmi samples are saved at a specific point in time.* ```javascript { value: 27.2, - startDate: '2016-07-08T12:00:00.000-0400', + startDate: '2016-07-08T12:00:00.000-0400', endDate: '2016-07-08T12:00:00.000-0400' } ``` @@ -690,7 +691,7 @@ On success, the callback function will be provided with a `bodyFatPercentage` ob ```javascript { value: 20, - startDate: '2016-07-08T12:00:00.000-0400', + startDate: '2016-07-08T12:00:00.000-0400', endDate: '2016-07-08T12:00:00.000-0400' } ``` @@ -713,7 +714,7 @@ On success, the callback function will be provided with a `leanBodyMass` object ```javascript { value: 176, - startDate: '2016-07-08T12:00:00.000-0400', + startDate: '2016-07-08T12:00:00.000-0400', endDate: '2016-07-08T12:00:00.000-0400' } ``` diff --git a/examples/StepsDemo/app/components/home/index.js b/examples/StepsDemo/app/components/home/index.js index cbb686c22b408661336bd45417a78711a310fc90..53858c35d1157c42e45d5bf17e5f1b86cb81ddac 100644 --- a/examples/StepsDemo/app/components/home/index.js +++ b/examples/StepsDemo/app/components/home/index.js @@ -9,8 +9,10 @@ import { ScrollView, Image, Text, - View + View, + NativeAppEventEmitter, } from 'react-native'; + import AppleHealthKit from 'react-native-apple-healthkit'; import styles from '../../styles/styles'; import History from './history'; @@ -58,6 +60,19 @@ class Home extends Component { if(this._handleHKError(err, 'initHealthKit')){ return; } + + AppleHealthKit.initStepCountObserver({}, () => {}); + + var subscription = NativeAppEventEmitter.addListener( + 'change:steps', + (evt) => { + console.log('change:steps EVENT!! : ', evt); + this._fetchStepsToday(); + } + ); + + this.sub = subscription; + this._fetchStepsToday(); this._fetchStepsHistory(); }); @@ -65,6 +80,10 @@ class Home extends Component { }); } + componentWillUnmount() { + this.sub.remove(); + } + /** * get today's step count from HealthKit. on success update * the component state diff --git a/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj b/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj index c9481ba613699a25bcb30cb5dab21e2afd639b1a..c433bfce6c74dda19f3efe00808fe221fb3f73ef 100644 --- a/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj +++ b/examples/StepsDemo/ios/StepsDemo.xcodeproj/project.pbxproj @@ -22,8 +22,8 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; + 377F68B31D7A0D9C00B64DB1 /* libRCTAppleHealthKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 377F68B21D7A0D9800B64DB1 /* libRCTAppleHealthKit.a */; }; 378616B61D257B040027C300 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378616B51D257B040027C300 /* HealthKit.framework */; }; - 378DCB741D3190C800E83D06 /* libRCTAppleHealthKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 378DCB731D3190C100E83D06 /* libRCTAppleHealthKit.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -91,9 +91,9 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; - 378DCB721D3190C100E83D06 /* PBXContainerItemProxy */ = { + 377F68B11D7A0D9800B64DB1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 378DCB6E1D3190C100E83D06 /* RCTAppleHealthKit.xcodeproj */; + containerPortal = 377F68AD1D7A0D9800B64DB1 /* RCTAppleHealthKit.xcodeproj */; proxyType = 2; remoteGlobalIDString = 3774C88D1D2092F20000B3F3; remoteInfo = RCTAppleHealthKit; @@ -134,9 +134,9 @@ 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 = ""; }; + 377F68AD1D7A0D9800B64DB1 /* 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 = ""; }; - 378DCB6E1D3190C100E83D06 /* RCTAppleHealthKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAppleHealthKit.xcodeproj; path = "../node_modules/react-native-apple-healthkit/RCTAppleHealthKit.xcodeproj"; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -154,7 +154,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 378DCB741D3190C800E83D06 /* libRCTAppleHealthKit.a in Frameworks */, + 377F68B31D7A0D9C00B64DB1 /* libRCTAppleHealthKit.a in Frameworks */, + 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 378616B61D257B040027C300 /* HealthKit.framework in Frameworks */, @@ -165,7 +166,6 @@ 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, - 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -268,10 +268,10 @@ name = Products; sourceTree = ""; }; - 378DCB6F1D3190C100E83D06 /* Products */ = { + 377F68AE1D7A0D9800B64DB1 /* Products */ = { isa = PBXGroup; children = ( - 378DCB731D3190C100E83D06 /* libRCTAppleHealthKit.a */, + 377F68B21D7A0D9800B64DB1 /* libRCTAppleHealthKit.a */, ); name = Products; sourceTree = ""; @@ -287,7 +287,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( - 378DCB6E1D3190C100E83D06 /* RCTAppleHealthKit.xcodeproj */, + 377F68AD1D7A0D9800B64DB1 /* RCTAppleHealthKit.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, @@ -411,8 +411,8 @@ ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; }, { - ProductGroup = 378DCB6F1D3190C100E83D06 /* Products */; - ProjectRef = 378DCB6E1D3190C100E83D06 /* RCTAppleHealthKit.xcodeproj */; + ProductGroup = 377F68AE1D7A0D9800B64DB1 /* Products */; + ProjectRef = 377F68AD1D7A0D9800B64DB1 /* RCTAppleHealthKit.xcodeproj */; }, { ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; @@ -516,11 +516,11 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 378DCB731D3190C100E83D06 /* libRCTAppleHealthKit.a */ = { + 377F68B21D7A0D9800B64DB1 /* libRCTAppleHealthKit.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libRCTAppleHealthKit.a; - remoteRef = 378DCB721D3190C100E83D06 /* PBXContainerItemProxy */; + remoteRef = 377F68B11D7A0D9800B64DB1 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { diff --git a/examples/StepsDemo/ios/StepsDemo/AppDelegate.m b/examples/StepsDemo/ios/StepsDemo/AppDelegate.m index a3c062c19e8d47640a53af1f5c1520d287561159..1e3212c106a113b749bb43dc57f9ec89898e91c3 100644 --- a/examples/StepsDemo/ios/StepsDemo/AppDelegate.m +++ b/examples/StepsDemo/ios/StepsDemo/AppDelegate.m @@ -31,7 +31,7 @@ * 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.13: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