Commit 29a807dc authored by Greg Wilson's avatar Greg Wilson

working on StepsDemo example app... wip

parent 555e1bfa
/**
* Created by greg on 2016-06-30.
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Navigator,
Text,
View
} from 'react-native';
let Home = require('./components/home/index');
let Add = require('./components/add/index');
class StepsDemoApp extends Component {
render() {
return (
<Navigator
style={{ flex:1 }}
initialRoute={{ name: 'Home' }}
renderScene={ this.renderScene } />
);
}
renderScene(route, navigator) {
if(route.name == 'Home') {
return <Home navigator={navigator} />
}
if(route.name == 'Add') {
return <Add navigator={navigator} />
}
}
}
module.exports = StepsDemoApp;
export default StepsDemoApp;
/**
* Created by greg on 2016-06-30.
*/
import React, { Component } from 'react';
import {
Navigator,
TouchableOpacity,
ScrollView,
Text,
View
} from 'react-native';
import TimerMixin from 'react-timer-mixin';
var reactMixin = require('react-mixin');
import styles from '../../styles/styles';
class Add extends Component {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
}
componentWillUnmount() {
}
_onPressItem(key) {
console.log('_onPressItem() ==> ', key);
let self = this;
this.requestAnimationFrame(() => {
this.props.navigator.push({
name: key
});
})
}
render() {
return (
<Navigator
renderScene={this.renderScene.bind(this)}
navigator={this.props.navigator}
navigationBar={
<Navigator.NavigationBar style={styles.navigationBar}
routeMapper={NavigationBarRouteMapper} />
}/>
);
}
renderScene(route, navigator) {
return (
<View style={styles.sceneContainerWithNavbar}>
<Text>Add Steps</Text>
</View>
);
}
}
reactMixin(Add.prototype, TimerMixin);
var NavigationBarRouteMapper = {
LeftButton(route, navigator, index, nextState) {
return (
<TouchableOpacity style={styles.navbarTitleTouchable} onPress={() => {navigator.parentNavigator.pop()}}>
<Text style={styles.navbarTitle}>
Back
</Text>
</TouchableOpacity>
);
},
RightButton(route, navigator, index, nextState) {
return null;
},
Title(route, navigator, index, nextState) {
return (
<TouchableOpacity style={styles.navbarTitleTouchable}>
<Text style={styles.navbarTitle}>
Add Steps
</Text>
</TouchableOpacity>
);
}
};
module.exports = Add;
export default Add;
\ No newline at end of file
/**
* Created by greg on 2016-06-30.
*/
import React, { Component } from 'react';
import {
Navigator,
TouchableOpacity,
TouchableHighlight,
ScrollView,
ListView,
RecyclerViewBackedScrollView,
Text,
View
} from 'react-native';
import _ from 'lodash';
//import TimerMixin from 'react-timer-mixin';
//var reactMixin = require('react-mixin');
import styles from '../../styles/styles';
class History extends Component {
constructor(props) {
super(props);
let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
if(_.isArray(this.props.data)){
ds = ds.cloneWithRows(this.props.data);
}
this.state = {
dataSource: ds,
};
}
componentDidMount() {}
componentWillUnmount() {}
componentWillReceiveProps(newProps) {
if(newProps && newProps.data && _.isArray(newProps.data)){
this.setState({
dataSource: this.state.dataSource.cloneWithRows(newProps.data),
});
}
}
render() {
return (
<ListView
dataSource={this.state.dataSource}
renderRow={this._renderRow}
renderScrollComponent={props => <RecyclerViewBackedScrollView {...props} />}
/>
);
}
_renderRow(rowData: Object, sectionID: number, rowID: number, highlightRow: (sectionID: number, rowID: number) => void) {
return (
<TouchableHighlight onPress={() => {
//this._pressRow(rowID);
highlightRow(sectionID, rowID);
}}>
<View>
<View style={styles.listViewRow}>
<Text style={{flex:1,}}>
{rowData.value + ' - ' + rowData.startDate}
</Text>
</View>
</View>
</TouchableHighlight>
);
}
}
//reactMixin(History.prototype, TimerMixin);
module.exports = History;
export default History;
/**
* Created by greg on 2016-06-30.
*/
import React, { Component } from 'react';
import {
Navigator,
TouchableOpacity,
ScrollView,
Text,
View
} from 'react-native';
import TimerMixin from 'react-timer-mixin';
var reactMixin = require('react-mixin');
import styles from '../../styles/styles';
var AppleHealthKit = require('react-native-apple-healthkit');
import History from './history';
const HKOPTIONS = {
permissions: {
read: ['Steps'],
write: ['Steps'],
}
};
class Home extends Component {
constructor(props) {
super(props);
this.state = {
stepsToday: 0,
stepHistory: [],
};
}
componentDidMount() {
AppleHealthKit.isAvailable((err,available) => {
if(available){
AppleHealthKit.initHealthKit(HKOPTIONS, (err, res) => {
if(this._handleHKError(err, 'initHealthKit')){
return;
}
this._fetchStepsToday();
this._fetchStepsHistory();
});
}
});
}
componentWillUnmount() {
}
_fetchStepsToday() {
AppleHealthKit.getStepCountForToday(null, (err, steps) => {
if(this._handleHKError(err, 'getStepCountForToday')){
return;
}
this.setState({stepsToday: steps});
});
}
_fetchStepsHistory() {
let options = {
startDate: (new Date(2016,4,1)).toISOString(),
};
AppleHealthKit.getDailyStepSamples(options, (err, res) => {
if(this._handleHKError(err, 'getDailyStepSamples')){
return;
}
this.setState({stepHistory: res});
});
}
_onPressItem(key) {
console.log('_onPressItem() ==> ', key);
let self = this;
this.requestAnimationFrame(() => {
this.props.navigator.push({
name: key
});
})
}
render() {
return (
<Navigator
renderScene={this.renderScene.bind(this)}
navigator={this.props.navigator}
navigationBar={
<Navigator.NavigationBar style={styles.navigationBar}
routeMapper={NavigationBarRouteMapper} />
}/>
);
}
renderScene(route, navigator) {
return (
<View style={styles.sceneContainerWithNavbar}>
<View style={styles.stepsContainer}>
<Text>
STEPS: {this.state.stepsToday}
</Text>
</View>
<View style={styles.historyContainer}>
<History data={this.state.stepHistory} />
</View>
</View>
);
}
_handleHKError(err, method) : boolean {
if(err){
let errStr = 'HealthKit_ERROR['+method+'] : ';
if(typeof err === 'string'){
errStr += err;
} else if (typeof err === 'object' && err.message){
errStr += err.message;
}
console.log(errStr);
return true;
}
return false;
}
}
reactMixin(Home.prototype, TimerMixin);
var NavigationBarRouteMapper = {
LeftButton(route, navigator, index, nextState) {
return null;
},
RightButton(route, navigator, index, nextState) {
return null;
},
Title(route, navigator, index, nextState) {
return (
<TouchableOpacity style={styles.navbarTitleTouchable}>
<Text style={styles.navbarTitle}>
HealthKit Steps
</Text>
</TouchableOpacity>
);
}
};
module.exports = Home;
export default Home;
/**
* Created by greg on 2016-06-30.
*/
import {
Platform,
StyleSheet
} from 'react-native';
const styles = StyleSheet.create({
sceneContainerWithNavbar: {
flex: 1,
flexDirection: 'column',
//justifyContent: 'flex-start',
//alignItems: 'flex-start',
marginTop: (Platform.OS === 'ios') ? 64 : 54,
backgroundColor: '#FFFFFF'
},
navigationBar: {
borderBottomWidth: 1,
borderBottomColor: '#cccccc',
backgroundColor: '#f5f5f5'
},
navbarTitleTouchable: {
flex: 1,
justifyContent: 'center'
},
navbarTitle: {
color: '#FD2D55',
margin: 10,
fontSize: 18
},
stepsContainer: {
height:100,
backgroundColor: '#FF8000',
},
historyContainer: {
flex: 1,
backgroundColor: '#0088cc',
},
listViewRow: {
flexDirection: 'row',
justifyContent: 'center',
padding: 10,
backgroundColor: '#F6F6F6',
},
row_1_3: {
flex: 0.33,
flexDirection:'column',
padding:10,
//backgroundColor: '#FF8000'
},
row_2_3: {
flex: 0.66,
flexDirection:'column',
padding:10,
//backgroundColor: '#0088cc'
},
borderTopLightGrey: {
borderTopColor: '#CCCCCC',
borderTopWidth: 1,
},
largeCenteredText: {
textAlign: 'center',
flexDirection:'row',
fontSize:34,
marginTop:60,
},
dashboardListItemLabel: {
fontSize:12,
color: '#FD2D55',
position:'absolute',
left: 70,
top:0,
},
dashboardListItemValue: {
fontSize:22,
color: '#47a292',
position:'absolute',
left: 70,
top:15,
},
sceneContainerFull: {
flex: 1,
flexDirection: 'column',
//justifyContent: 'flex-start',
//alignItems: 'flex-start',
marginTop: 0,
backgroundColor: '#FFFFFF'
},
dashboardToday: {
height: 30,
alignItems: 'stretch',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(162, 162, 162, 0.2)',
},
dashboardTodayText: {
color: '#a2a2a2',
},
dashboardListItemHighlight: {
flexDirection: 'row',
alignSelf: 'stretch',
justifyContent: 'center',
//flex:1,
//alignSelf: 'stretch',
//overflow: 'hidden',
},
dashboardListItemView: {
flex: 1,
//backgroundColor: '#FDFDFD',
backgroundColor: '#FDFDFD',
//paddingTop:74,
//flexDirection: 'row',
flexDirection: 'column',
alignSelf: 'stretch',
justifyContent: 'flex-start',
alignItems: 'flex-start',
paddingTop:15,
paddingBottom: 15,
//flexWrap: 'wrap',
borderBottomColor: '#AAAAAA',
borderBottomWidth: 1,
},
dashboardListItemViewTransparent: {
flex: 1,
//backgroundColor: '#FDFDFD',
backgroundColor: 'transparent',
//paddingTop:74,
//flexDirection: 'row',
flexDirection: 'column',
alignSelf: 'stretch',
justifyContent: 'flex-start',
alignItems: 'flex-start',
paddingTop:15,
paddingBottom: 15,
//flexWrap: 'wrap',
borderBottomColor: '#AAAAAA',
borderBottomWidth: 1,
},
dashboardListItem: {
flexDirection: 'row',
alignSelf: 'stretch',
justifyContent: 'space-between',
flex:1,
backgroundColor: 'transparent',
},
dashboardListItemIcon: {
width: 40,
height: 40,
marginLeft: 10,
opacity:0.7,
//marginTop: 50,
//backgroundColor: 'transparent',
alignSelf: 'flex-start',
},
dashboardListItemText: {
flex: 1,
flexDirection: 'column',
alignSelf: 'flex-start',
marginLeft: 20,
fontSize: 29,
color: '#47a292',
//color: '#98CA3F',
//color: '#644496',
flexWrap: 'wrap',
backgroundColor:'transparent',
},
});
module.exports = styles;
export default styles;
\ No newline at end of file
......@@ -12,21 +12,12 @@ import {
View
} from 'react-native';
import App from './app/app';
class StepsDemo extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
<App />
);
}
}
......
......@@ -22,6 +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 */; };
378616B61D257B040027C300 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 378616B51D257B040027C300 /* HealthKit.framework */; };
378616C51D259EE50027C300 /* libRCTAppleHealthKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 378616C41D259EE10027C300 /* libRCTAppleHealthKit.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
/* End PBXBuildFile section */
......@@ -89,6 +91,13 @@
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
remoteInfo = React;
};
378616C31D259EE10027C300 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 378616BF1D259EE00027C300 /* RCTAppleHealthKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3774C88D1D2092F20000B3F3;
remoteInfo = RCTAppleHealthKit;
};
78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
......@@ -106,17 +115,17 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = main.jsbundle; sourceTree = "<group>"; };
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = "<group>"; };
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = "<group>"; };
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = "<group>"; };
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = "<group>"; };
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = "<group>"; };
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = "<group>"; };
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = "<group>"; };
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = "<group>"; };
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = "<group>"; };
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = "<group>"; };
00E356EE1AD99517003FC87E /* StepsDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StepsDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* StepsDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StepsDemoTests.m; sourceTree = "<group>"; };
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = "<group>"; };
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = ../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = "<group>"; };
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = "<group>"; };
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = "<group>"; };
13B07F961A680F5B00A75B9A /* StepsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StepsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = StepsDemo/AppDelegate.h; sourceTree = "<group>"; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = StepsDemo/AppDelegate.m; sourceTree = "<group>"; };
......@@ -124,9 +133,12 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = StepsDemo/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = StepsDemo/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = StepsDemo/main.m; sourceTree = "<group>"; };
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../node_modules/react-native/React/React.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>"; };
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; };
378616B71D257B040027C300 /* StepsDemo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = StepsDemo.entitlements; path = StepsDemo/StepsDemo.entitlements; sourceTree = "<group>"; };
378616BF1D259EE00027C300 /* 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>"; };
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 */
/* Begin PBXFrameworksBuildPhase section */
......@@ -142,8 +154,10 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
378616C51D259EE50027C300 /* libRCTAppleHealthKit.a in Frameworks */,
146834051AC3E58100842450 /* libReact.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
378616B61D257B040027C300 /* HealthKit.framework in Frameworks */,
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
......@@ -234,6 +248,7 @@
13B07FAE1A68108700A75B9A /* StepsDemo */ = {
isa = PBXGroup;
children = (
378616B71D257B040027C300 /* StepsDemo.entitlements */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.m */,
......@@ -253,6 +268,14 @@
name = Products;
sourceTree = "<group>";
};
378616C01D259EE00027C300 /* Products */ = {
isa = PBXGroup;
children = (
378616C41D259EE10027C300 /* libRCTAppleHealthKit.a */,
);
name = Products;
sourceTree = "<group>";
};
78C398B11ACF4ADC00677621 /* Products */ = {
isa = PBXGroup;
children = (
......@@ -264,6 +287,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
378616BF1D259EE00027C300 /* RCTAppleHealthKit.xcodeproj */,
146833FF1AC3E56700842450 /* React.xcodeproj */,
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
......@@ -289,6 +313,7 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
378616B51D257B040027C300 /* HealthKit.framework */,
13B07FAE1A68108700A75B9A /* StepsDemo */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* StepsDemoTests */,
......@@ -359,6 +384,14 @@
CreatedOnToolsVersion = 6.2;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 95ZTJFHCUG;
SystemCapabilities = {
com.apple.HealthKit = {
enabled = 1;
};
};
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "StepsDemo" */;
......@@ -377,6 +410,10 @@
ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
},
{
ProductGroup = 378616C01D259EE00027C300 /* Products */;
ProjectRef = 378616BF1D259EE00027C300 /* RCTAppleHealthKit.xcodeproj */;
},
{
ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
......@@ -479,6 +516,13 @@
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
378616C41D259EE10027C300 /* libRCTAppleHealthKit.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTAppleHealthKit.a;
remoteRef = 378616C31D259EE10027C300 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
......@@ -528,7 +572,6 @@
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
showEnvVarsInLog = 1;
};
/* End PBXShellScriptBuildPhase section */
......@@ -606,19 +649,23 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = StepsDemo/StepsDemo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEAD_CODE_STRIPPING = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
);
INFOPLIST_FILE = "StepsDemo/Info.plist";
INFOPLIST_FILE = StepsDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
);
PRODUCT_NAME = StepsDemo;
PROVISIONING_PROFILE = "";
};
name = Debug;
};
......@@ -626,18 +673,22 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = StepsDemo/StepsDemo.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
);
INFOPLIST_FILE = "StepsDemo/Info.plist";
INFOPLIST_FILE = StepsDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"-ObjC",
"-lc++",
);
PRODUCT_NAME = StepsDemo;
PROVISIONING_PROFILE = "";
};
name = Release;
};
......
......@@ -32,7 +32,7 @@
*/
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"];
/**
* OPTION 2
* Load from pre-bundled file on disk. The static bundle is automatically
......
......@@ -22,11 +22,19 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>healthkit</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
......@@ -36,12 +44,5 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.healthkit</key>
<true/>
</dict>
</plist>
......@@ -6,7 +6,10 @@
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"lodash": "^4.13.1",
"react": "15.1.0",
"react-native": "^0.28.0"
"react-mixin": "^2.0.2",
"react-native": "^0.28.0",
"react-native-apple-healthkit": "file:///Users/greg/Dev/experimental/RCTAppleHealthKit"
}
}
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