,
41 | nextElement: ClassicElement,
42 | container: Element,
43 | callback?: (component: ClassicComponent
) => any): ClassicComponent
;
44 | function unstable_renderSubtreeIntoContainer
(
45 | parentComponent: Component,
46 | nextElement: ReactElement,
47 | container: Element,
48 | callback?: (component: Component
) => any): Component
;
49 | }
50 |
51 | namespace __DOMServer {
52 | function renderToString(element: ReactElement): string;
53 | function renderToStaticMarkup(element: ReactElement): string;
54 | var version: string;
55 | }
56 | }
57 |
58 | declare module "react-dom" {
59 | import DOM = __React.__DOM;
60 | export = DOM;
61 | }
62 |
63 | declare module "react-dom/server" {
64 | import DOMServer = __React.__DOMServer;
65 | export = DOMServer;
66 | }
67 |
--------------------------------------------------------------------------------
/app/app/pages/GuidePage.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by allen on 16/7/23.
3 | */
4 | import React, { Component } from 'react';
5 | import {
6 | AppRegistry,
7 | StyleSheet,
8 | View,
9 | Image,
10 | Dimensions,
11 | TouchableHighlight
12 | } from 'react-native';
13 | import Swiper from 'react-native-swiper';
14 | var width = Dimensions.get('window').width;
15 | var height = Dimensions.get('window').height;
16 | export default class GuidePage extends Component {
17 |
18 | _PressButton(){
19 | alert("跳转新的一页");
20 | }
21 | render() {
22 | return (
23 | }
25 | activeDot={}>
26 |
27 |
29 |
30 |
31 |
33 |
34 |
35 |
37 |
38 |
39 |
40 |
42 |
43 |
44 |
45 | )
46 | }
47 |
48 | }
49 | const styles = StyleSheet.create({
50 | flex: {
51 | flex: 1
52 | },
53 | container: {
54 | flex: 1,
55 | justifyContent: 'center',
56 | alignItems: 'center',
57 | backgroundColor: '#F5FCFF',
58 | },
59 | welcome: {
60 | fontSize: 20,
61 | textAlign: 'center',
62 | margin: 10,
63 | },
64 | instructions: {
65 | textAlign: 'center',
66 | color: '#333333',
67 | marginBottom: 5,
68 | },
69 | wrapper: {},
70 | slide1: {
71 | flex: 1,
72 | justifyContent: 'center',
73 | alignItems: 'center',
74 | backgroundColor: '#9DD6EB',
75 | },
76 | slide2: {
77 | flex: 1,
78 | justifyContent: 'center',
79 | alignItems: 'center',
80 | backgroundColor: '#97CAE5',
81 | },
82 | slide3: {
83 | flex: 1,
84 | justifyContent: 'center',
85 | alignItems: 'center',
86 | backgroundColor: '#92BBD9',
87 | },
88 | text: {
89 | color: '#fff',
90 | fontSize: 30,
91 | fontWeight: 'bold',
92 | }
93 | });
--------------------------------------------------------------------------------
/Redux 学习笔记.md:
--------------------------------------------------------------------------------
1 | # 1. Redux 是什么?
2 |
3 |
4 | ReactNative 架构Redux研究
5 | 字数1067 阅读5379 评论4 喜欢15
6 | 参考文档:http://camsong.github.io/redux-in-chinese/index.html
7 | 参考Demo:https://github.com/alinz/example-react-native-redux
8 | 参考文档 http://www.jianshu.com/p/14933fd9c312
9 |
10 | 01. ReactNative 架构Redux研究.jpg
11 | Redux是当前最热门的React架构。它的出现主要是为了修补Facebook官方推荐架构Flux的不足。
12 | [!]
13 |
14 | 02. Redux开发环境搭建.jpg
15 | Redux开发环境搭建非常简单。需要注意的是,由于目前React-Native 0.17.0 的兼容性不好,建议大家先用0.16.0,并关注0.18.0的更新。
16 |
17 |
18 | 03. Redux 三个要点.jpg
19 | Redux为了达到对组件state的控制,禁止直接修改state,而是通过action触发reducers的方式来更新state树。
20 |
21 |
22 | 04. Redux概览.jpg
23 | Redux的主要工作在store上。通过store持有状态树,监听、分发action。
24 |
25 |
26 | 05. Redux 三原则.jpg
27 | State只读,可能让人比较费解。Redux并不直接修改state树,而是创建state树副本,更新后,直接替换旧的state树。
28 |
29 |
30 | 06. Rx 异步流.jpg
31 | Rx与Redux配合良好,可以把Redux store作为可观察变量处理。
32 |
33 |
34 | 07. Action.jpg
35 | Action是Redux处理数据的开始。数据的任何变化都应该有相应的Action。
36 |
37 |
38 | 08. Reducer.jpg
39 | Reducer是数据的处理中心。编写完成后,它应该作为一种黑盒的存在。
40 |
41 |
42 | 09. Reducer 更新State.jpg
43 | 通过Object.assign创建state副本后再进行修改,不要直接修改原state。
44 |
45 |
46 | 10. Reducer 合成.jpg
47 | 通过子Reducer函数管理不同的分组数据,最后合成唯一一棵state树。
48 |
49 |
50 | 11. Store 职责.jpg
51 | Store负责对整个state树进行管理。通过监听action,实现数据的传递。
52 |
53 |
54 | 12. Store 创建、监听、分发.jpg
55 | 组件卸载时,要注意停止store的监听,以免影响性能。
56 |
57 |
58 | 13. 数据流.jpg
59 | 数据流从用户行为触发的action开始。
60 | Action->Store->Reducer->Store->UI。
61 |
62 |
63 | 14. React-Redux.jpg
64 | Redux是独立的库,需要通过React-Redux库实现与React Native的配合使用。
65 | 设计组件的层次结构,主要搞清楚不同的组件需要处理什么数据,实现什么功能的回调。
66 |
67 |
68 | 15.React 连接到Redux.jpg
69 | Redux通过Provider和connect两个组件,实现与React的连接。
70 |
71 |
72 | 16. 完整的 ReactNative APP文件结构.jpg
73 | Redux的主要工作在容器组件上。Actions和Reducers都是纯函数。
74 |
75 |
76 | 17. Redux APP 结构.jpg
77 | store和 connect这层是开发调试时的主要对象。
78 |
79 |
80 | 18. 异步Action.jpg
81 | 异步Action,一般需要提供三种以上的状态Action。
82 |
83 |
84 | 19.state 结构.jpg
85 | 通过ID引用数据,可以实现更简洁清晰的数据结构。
86 |
87 |
88 | 20. redux-thunk.jpg
89 | 中间件技术,通过切片组合,使得action传递过程中可以实现更多的控制。
90 |
91 |
92 | 21.Fetch.jpg
93 | Fetch是更简洁清晰的请求方式。
94 |
95 |
96 | 22.服务端渲染:异步 action creator.jpg
97 | 直接在action creator里dispatch 请求action,将使得业务逻辑更连贯。
98 |
99 |
100 | 23.处理异步Action的选择.jpg
101 | Thunk middleware是目前最多人使用的方案。
102 |
103 |
104 | 24.异步数据流.jpg
105 | 异步数据流通过使用异步中间件包装store的dispatch方法来实现。最终要返回一个普通对象的action,重回同步数据流。
106 |
107 |
108 | 25.中间件 Middleware.jpg
109 | 链式组合,使得代码逻辑更简单清晰。
110 |
111 |
112 | 26.Middleware 的演化.jpg
113 | 中间件可以层层叠加,非常灵活地修改功能函数的功能。
114 |
115 |
116 | 27. Redux迁移-Flux 项目.jpg
117 | 迁移的关键工作在于把Flux store重写为Redux 的reducer。
118 |
119 |
120 | 28.减少样板代码.jpg
121 | 通过上面的原则,可以使Redux App的代码更易于维护。
122 |
123 |
124 | 29.服务端渲染.jpg
125 | 服务端渲染可以进一步提升React 的性能。
126 |
127 |
128 | 30.Redux 测试.jpg
129 | Action 和 Reducer都是纯函数,使得测试可以覆盖到更多代码。
130 |
131 |
132 | 31.计算衍生数据.jpg
133 | Reselect 可以省去数据不必要的重新计算。
134 |
135 |
136 | 32.实现撤销历史.jpg
137 | 通过同时维护三个数据域来实现撤销与重做。
138 |
139 |
140 | 33. Redux Undo.jpg
141 | Redux-undo使得撤销重做更容易实现。
142 |
143 | 如果你有任何问题想找我交流,可以到我的支付宝经费群来找我:)
--------------------------------------------------------------------------------
/Text 组件练习.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | Image,
11 | StyleSheet,
12 | Text,
13 | View,
14 | ListView,
15 | PixelRatio,
16 | TouchableOpacity
17 | } from 'react-native';
18 | const Header = require('./header');
19 | class AwesomeProject extends Component {
20 |
21 | render() {
22 | return (
23 |
24 |
25 |
26 |
27 |
28 |
32 |
33 | );
34 | }
35 |
36 |
37 | }
38 | class ImportantNew extends Component {
39 | show(title) {
40 | alert(title);
41 | }
42 |
43 | render() {
44 |
45 | var news = [];
46 | for (var i in this.props.news) {
47 | var text = (
48 | {this.props.news[i]}
53 | );
54 | news.push(text);
55 | }
56 | return (
57 | 今日要闻
58 | {news}
59 |
60 | );
61 | }
62 | }
63 | class List extends Component {
64 | render() {
65 | return (
66 | {this.props.title}
67 | );
68 | };
69 | }
70 | const styles = StyleSheet.create({
71 | container: {
72 | marginTop: 200,
73 | marginLeft: 5,
74 | marginRight: 5,
75 | height: 84,
76 | flexDirection: 'row',
77 | borderRadius: 5,
78 | padding: 2,
79 | backgroundColor: '#FF0067',
80 |
81 | },
82 | list_item: {
83 | height: 40,
84 | marginLeft: 10,
85 | marginRight: 10,
86 | borderBottomWidth: 1,
87 | borderBottomColor: "#ddd",
88 | justifyContent: 'center',
89 | },
90 | list_item_font: {
91 | fontSize: 16,
92 | },
93 | new_title: {
94 | fontSize: 20,
95 | fontWeight: 'bold',
96 | color: '#CD1D1C',
97 | marginLeft: 10,
98 | marginTop: 15
99 | },
100 | news_item: {
101 | marginLeft: 10,
102 | marginRight: 10,
103 | fontSize: 15,
104 | lineHeight: 40
105 | }
106 |
107 | });
108 |
109 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
110 |
--------------------------------------------------------------------------------
/携程界面.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | Image,
11 | StyleSheet,
12 | Text,
13 | View,
14 | ListView,
15 | PixelRatio,
16 | TouchableOpacity
17 | } from 'react-native';
18 | class AwesomeProject extends Component {
19 |
20 | render() {
21 | return (
22 |
23 | 酒店
24 |
25 |
26 |
27 | 海外酒店
28 |
29 |
30 |
31 | 特惠酒店
32 |
33 |
34 |
35 |
36 | 团购
37 |
38 |
39 |
40 | 客栈。公寓
41 |
42 |
43 |
44 | );
45 | }
46 |
47 |
48 | }
49 | const styles = StyleSheet.create({
50 | container: {
51 | marginTop: 200,
52 | marginLeft: 5,
53 | marginRight: 5,
54 | height: 84,
55 | flexDirection: 'row',
56 | borderRadius: 5,
57 | padding: 2,
58 | backgroundColor: '#FF0067',
59 |
60 | },
61 | item: {
62 | flex: 1,
63 | height: 80,
64 | },
65 | center: {
66 | justifyContent: 'center',
67 | alignItems: 'center'
68 | },
69 | font:{
70 | color:'#fff',
71 | fontSize:16,
72 | fontWeight:'bold'
73 | },
74 | flex: {
75 | flex: 1
76 | },
77 | lineLeftRight:{
78 | borderColor:'#fff',
79 | borderLeftWidth:1/PixelRatio.get(),
80 | borderRightWidth:1/PixelRatio.get()
81 | },
82 | lineCenter:{
83 | borderBottomWidth:1/PixelRatio.get(),
84 | borderColor:'#fff'
85 | },
86 | welcome: {
87 | fontSize: 20,
88 | textAlign: 'center',
89 | margin: 10,
90 | },
91 | instructions: {
92 | textAlign: 'center',
93 | color: '#333333',
94 | marginBottom: 5,
95 | },
96 | thumbnail: {
97 | width: 53,
98 | height: 81,
99 | },
100 | rightContainer: {
101 | flex: 1,
102 | },
103 | title: {
104 | fontSize: 20,
105 | marginBottom: 8,
106 | textAlign: 'center',
107 | },
108 | year: {
109 | textAlign: 'center',
110 | },
111 | listView: {
112 | paddingTop: 20,
113 | backgroundColor: '#F5FCFF',
114 | },
115 | button: {
116 | height: 40,
117 | width: 400,
118 | backgroundColor: 'green',
119 | justifyContent: 'center',
120 | },
121 | buttonText: {
122 | textAlign: 'center',
123 | color: 'white'
124 | }
125 |
126 | });
127 |
128 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
129 |
--------------------------------------------------------------------------------
/app/ios/app/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/app/containers/MainContainer.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by allen on 16/7/23.
3 | */
4 | 'use strict'
5 | import React,{Component} from 'react';
6 | import {
7 | View,
8 | Text,
9 | Image,
10 | StyleSheet,
11 | Dimensions,
12 | StatusBar
13 | } from 'react-native';
14 | import TabNavigator from 'react-native-tab-navigator';
15 | import Home from '../pages/Home';
16 | import Product from '../pages/Product';
17 | import Account from '../pages/Account';
18 | import More from '../pages/More';
19 | var height = Dimensions.get('window').height;
20 | export default class MainContainer extends Component {
21 | constructor(props) {
22 | super(props);
23 | this.state = {
24 | selectedTab:'home'
25 |
26 | };
27 | console.log(this.state.selectedTab);
28 | }
29 |
30 | render() {
31 |
32 | return (
33 |
34 |
35 | }
41 | renderSelectedIcon={() => }
42 | onPress={() => this.setState({ selectedTab: 'home' })}>
43 |
44 |
45 | }
51 | renderSelectedIcon={() => }
52 | onPress={() => this.setState({ selectedTab: 'product' })}>
53 |
54 |
55 | }
61 | renderSelectedIcon={() => }
62 | onPress={() => this.setState({ selectedTab: 'account' })}>
63 |
64 |
65 | }
71 | renderSelectedIcon={() => }
72 | onPress={() => this.setState({ selectedTab: 'more' })}>
73 |
74 |
75 |
76 | );
77 | }
78 | }
79 | const styles=StyleSheet.create({
80 | iconStyle:{
81 | width:26,
82 | height:26,
83 | },
84 | textStyle:{
85 | color:'#838c93',
86 | },
87 | selectedTextStyle:{
88 | color:'black',
89 | }
90 | });
--------------------------------------------------------------------------------
/app/app/pages/Splash.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | import React from 'react';
3 | import {
4 | Dimensions,
5 | Image,
6 | InteractionManager
7 |
8 | } from 'react-native';
9 | import MainContainer from '../containers/MainContainer.js'
10 | import GuidePage from '../pages/GuidePage';
11 | /**
12 | * 对象解构赋值
13 | * @type {*|Object}
14 | */
15 | var {width,height,scale,fontScale} = Dimensions.get('window');
16 | import Storage from 'react-native-storage';
17 | var storge = new Storage();
18 | var DeviceInfo = require('react-native-device-info');
19 | var version ;
20 | export default class Splash extends React.Component {
21 | constructor(props) {
22 | super(props);
23 |
24 |
25 | }
26 |
27 | componentDidMount() {
28 |
29 | console.log("Device Unique ID", DeviceInfo.getUniqueID()); // e.g. FCDBD8EF-62FC-4ECB-B2F5-92C9E79AC7F9
30 | // * note this is IDFV on iOS so it will change if all apps from the current apps vendor have been previously uninstalled
31 |
32 | console.log("Device Manufacturer", DeviceInfo.getManufacturer()); // e.g. Apple
33 |
34 | console.log("Device Model", DeviceInfo.getModel()); // e.g. iPhone 6
35 |
36 | console.log("Device ID", DeviceInfo.getDeviceId()); // e.g. iPhone7,2 / or the board on Android e.g. goldfish
37 |
38 | console.log("Device Name", DeviceInfo.getSystemName()); // e.g. iPhone OS
39 |
40 | console.log("Device Version", DeviceInfo.getSystemVersion()); // e.g. 9.0
41 |
42 | console.log("Bundle Id", DeviceInfo.getBundleId()); // e.g. com.learnium.mobile
43 |
44 | console.log("Build Number", DeviceInfo.getBuildNumber()); // e.g. 89
45 |
46 | console.log("App Version", DeviceInfo.getVersion()); // e.g. 1.1.0
47 |
48 | console.log("App Version (Readable)", DeviceInfo.getReadableVersion()); // e.g. 1.1.0.89
49 |
50 | console.log("Device Name", DeviceInfo.getDeviceName()); // e.g. Becca's iPhone 6
51 |
52 | console.log("User Agent", DeviceInfo.getUserAgent()); // e.g. Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 4 - 5.1.0 - API 22 - 768x1280 Build/LMY47D)
53 |
54 |
55 | const {navigator} = this.props;
56 | storge.load({
57 | key:'AppVersion',
58 | autoSync:true,
59 | }).then(ret =>{
60 | version = ret.AppVersion;
61 | console.log(JSON.stringify(version))
62 | }).catch(err => {
63 | // 如果没有找到数据且没有同步方法,
64 | // 或者有其他异常,则在catch中返回
65 | console.warn(err);
66 | })
67 |
68 | this.timer = setTimeout(()=> {
69 | InteractionManager.runAfterInteractions(() => {
70 | if (version ===DeviceInfo.getVersion()){
71 | navigator.resetTo({
72 | component: MainContainer,
73 | name: 'Main'
74 | });
75 | }else{
76 | storge.save({
77 | key:'AppVersion',
78 | rawData:{
79 | AppVersion:DeviceInfo.getVersion(),
80 | }
81 | ,
82 | expires:null
83 | });
84 | navigator.resetTo({
85 | component: GuidePage,
86 | name: 'GuidePage'
87 | });
88 | console.log(DeviceInfo.getVersion());
89 |
90 | }
91 |
92 | });
93 | }, 1000)
94 | }
95 |
96 | componentWillUnMount() {
97 | this.timer && clearTimeout(this.timer);
98 | }
99 |
100 | render() {
101 | return (
102 |
105 | );
106 | }
107 |
108 | }
--------------------------------------------------------------------------------
/Navigator.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | Image,
11 | StyleSheet,
12 | Text,
13 | View,
14 | ListView,
15 | PixelRatio,
16 | TouchableOpacity,
17 | Navigator,
18 | ScrollView
19 | } from 'react-native';
20 | const Header = require('./header');
21 |
22 | class AwesomeProject extends Component {
23 |
24 | render() {
25 | let defaultName = 'List';
26 | let defaultComponent = List;
27 | return (
28 | {
31 | return Navigator.SceneConfigs.VerticalDownSwipeJump;
32 | }}
33 | renderScene={(route, navigator) => {
34 | let Component = route.component;
35 | return
36 | }} />
37 | );
38 | }
39 |
40 | }
41 | class List extends Component {
42 | // 构造
43 | constructor(props) {
44 | super(props);
45 | // 初始状态
46 | this.state = {
47 | id: 1,
48 | author: null
49 | };
50 | }
51 |
52 | _pressButton() {
53 | const {navigator }= this.props;
54 | if (navigator) {
55 | navigator.push({
56 | name: 'Detail',
57 | component: Detail,
58 | parms: {
59 | id: this.state.id,
60 | getUser: function (user) {
61 | self.setState({
62 | user: user
63 | });
64 | }
65 |
66 | }
67 | })
68 | }
69 |
70 | }
71 |
72 | render() {
73 | return(
74 | 作者是: {this.state.author }
75 | 豪华游轮三日游
76 | 豪华游轮三日游
77 | );
78 | }
79 | }
80 | class Detail extends Component {
81 | // 构造
82 | constructor(props) {
83 | super(props);
84 | // 初始状态
85 | this.state = {};
86 | }
87 |
88 | _pressButton() {
89 | const {navigator }= this.props;
90 | if (navigator) {
91 | navigator.pop();
92 | }
93 |
94 | }
95 |
96 | render() {
97 | return(
98 | 点我可以弹回去
99 | );
100 | }
101 | }
102 | const styles = StyleSheet.create({
103 | container: {
104 | marginTop: 200,
105 | marginLeft: 5,
106 | marginRight: 5,
107 | height: 84,
108 | flexDirection: 'row',
109 | borderRadius: 5,
110 | padding: 2,
111 | backgroundColor: '#FF0067',
112 |
113 | },
114 | list_item: {
115 | height: 40,
116 | marginLeft: 10,
117 | marginRight: 10,
118 | borderBottomWidth: 1,
119 | borderBottomColor: "#ddd",
120 | justifyContent: 'center',
121 | },
122 | list_item_font: {
123 | fontSize: 16,
124 | },
125 | new_title: {
126 | fontSize: 20,
127 | fontWeight: 'bold',
128 | color: '#CD1D1C',
129 | marginLeft: 10,
130 | marginTop: 15
131 | },
132 | news_item: {
133 | marginLeft: 10,
134 | marginRight: 10,
135 | fontSize: 15,
136 | lineHeight: 40
137 | }
138 |
139 | });
140 |
141 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
142 |
--------------------------------------------------------------------------------
/app/app/pages/Account.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by allen on 16/7/23.
3 | */
4 | 'use strict'
5 | import React from 'react';
6 | import {
7 | View,
8 | Text,
9 | ScrollView,
10 | RefreshControl,
11 | StyleSheet,
12 | Image
13 | } from 'react-native';
14 | export default class Account extends React.Component {
15 | // 构造
16 | constructor(props) {
17 | super(props);
18 | // 初始状态
19 | this.state = {
20 | isRefreshing: false,
21 | };
22 | }
23 |
24 | render() {
25 | return (
26 |
35 | }>
36 |
37 |
38 |
39 | 137****5872
40 |
41 |
42 | 0优惠卷
43 |
44 | 0瓜币
45 |
46 |
47 |
48 |
49 |
50 |
51 | 账户提现
52 |
53 |
54 |
55 | 账户充值
56 |
57 |
58 |
59 | )
60 | }
61 |
62 | _onRefresh() {
63 | //this.state({
64 | // isRefreshing: true
65 | // }
66 | //)
67 | setTimeout(() => {
68 | // 准备下拉刷新的5条数据
69 | const rowData = Array.from(new Array(5))
70 | .map((val, i) => ({
71 | text: '刷新行 ' + (+this.state.loaded + i)
72 | }))
73 | .concat(this.state.rowData);
74 |
75 | this.setState({
76 | loaded: this.state.loaded + 5,
77 | isRefreshing: false,
78 | rowData: rowData,
79 | });
80 | }, 5000);
81 | }
82 | }
83 | const styles = StyleSheet.create({
84 | scrollview: {
85 | flex: 1,
86 | },
87 | horization: {
88 | flexDirection: 'row',
89 | alignItems: 'center',
90 | },
91 | view: {
92 | alignItems: 'center',
93 | flexDirection: 'row',
94 | justifyContent: 'center'
95 | },
96 | phoneText: {
97 | marginTop: 10,
98 | color: 'white',
99 | fontSize: 14
100 | },
101 | couponText: {
102 | color: 'white',
103 | fontSize: 12,
104 | justifyContent: 'center',
105 | flex: 1,
106 | textAlign: 'center'
107 | },
108 | Image: {
109 | marginTop: 12,
110 | justifyContent: 'center',
111 | width: 60,
112 | height: 60
113 | },
114 | center: {
115 | alignItems: 'center',
116 | justifyContent: 'center',
117 | },
118 | rechargeText:{
119 | color: 'black',
120 | fontSize: 15,
121 | justifyContent: 'center',
122 | flex: 1,
123 | marginLeft:9,
124 | textAlign: 'center'
125 | }
126 | });
--------------------------------------------------------------------------------
/app/ios/app.xcodeproj/xcshareddata/xcschemes/app.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/app/app/pages/More.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by allen on 16/9/13.
3 | */
4 | /**
5 | * Created by allen on 16/7/23.
6 | */
7 | 'use strict'
8 | import React from 'react';
9 | import {
10 | View,
11 | Text,
12 | StyleSheet,
13 | Image
14 | } from 'react-native';
15 | export default class MainContainer extends React.Component {
16 | render() {
17 | return (
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | 消息中心
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | 帮助中心
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | 转发好友
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 联系我们
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | 意见反馈
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 检查更新
72 |
73 |
74 |
75 |
76 |
77 | )
78 | }
79 | }
80 | const styles = StyleSheet.create({
81 | lin: {
82 | flexDirection: 'column'
83 | },
84 | horizontal: {
85 | backgroundColor: 'white',
86 | flexDirection: 'row',
87 | height: 44,
88 | alignSelf:'center',
89 | alignItems:'center'
90 | },
91 | text: {
92 | fontSize: 16,
93 | color: '#333333',
94 | flex: 1,
95 | textAlign: 'left',
96 | marginLeft:14
97 | },
98 | Image: {
99 | width: 22,
100 | height: 23,
101 | marginLeft: 15
102 | },
103 | arrow:{
104 | height:23,
105 | width:22,
106 | marginRight:15
107 | },
108 | gray_line:{
109 | height:0.5,
110 | marginLeft:16,
111 | flexDirection: 'row'
112 | },
113 | line:{
114 | height:0.5,
115 | flexDirection: 'row'
116 | },
117 | top12:{
118 | height:12,
119 | backgroundColor:'#f1f1f1'
120 | }
121 |
122 | });
--------------------------------------------------------------------------------
/app/app/pages/Product.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by allen on 16/7/23.
3 | */
4 | 'use strict'
5 |
6 | import React,{Component} from 'react';
7 | import {
8 | ScrollView,
9 | StyleSheet,
10 | RefreshControl,
11 | Text,
12 | View,
13 | StatusBar
14 | } from 'react-native'
15 |
16 | const styles = StyleSheet.create({
17 | row: {
18 | borderColor: "#eee",
19 | borderWidth: 5,
20 | padding: 16,
21 | backgroundColor: 'white',
22 | flexDirection: "column"
23 | },
24 | horziation: {
25 | flexDirection: 'row',
26 | alignItems: 'flex-end',
27 | flex: 1
28 | },
29 | title_left: {
30 | color: '#3c76b8',
31 | fontSize: 14,
32 | justifyContent: 'space-between',
33 | flex: 1,
34 | alignSelf: 'flex-start',
35 | textAlign: 'center'
36 | }
37 | ,
38 | left: {
39 | color: '#333333',
40 | fontSize: 12,
41 | justifyContent: 'space-between',
42 | flex: 1,
43 | alignSelf: 'flex-start',
44 | textAlign: 'left'
45 | },
46 | center: {
47 | color: '#333333',
48 | fontSize: 12,
49 | justifyContent: 'space-between',
50 | flex: 1,
51 | alignSelf: 'center',
52 | textAlign: 'center'
53 | },
54 | right: {
55 | color: '#333333',
56 | fontSize: 12,
57 | justifyContent: 'space-between',
58 | flex: 1,
59 | alignSelf: 'flex-end',
60 | textAlign: 'right'
61 | },
62 | text: {
63 | color: '#333333',
64 | fontSize: 15,
65 | textAlign: 'left',
66 | justifyContent: 'flex-start'
67 | },
68 | symbolen: {
69 | color: '#333333',
70 | fontSize: 12,
71 | marginLeft: 8,
72 |
73 | },
74 | scrollview: {
75 | flex: 1,
76 | },
77 | marginleft5: {
78 | marginTop: 5
79 | }
80 | });
81 |
82 | export default class Row extends Component {
83 |
84 |
85 | // 构造
86 | constructor(props) {
87 | super(props);
88 | // 初始状态
89 | this.state = {
90 | symbolcn: "欧元",
91 | symbolen: "EURUSD",
92 | sell: "1.2333",
93 | buy: "1.354",
94 | sub: "1.233"
95 | };
96 | }
97 |
98 | _onClick() {
99 | this.props.onClick(this.props.data);
100 | }
101 |
102 | render() {
103 | return (
104 |
105 |
106 |
107 | {this.state.symbolcn}
108 | {this.state.symbolen}
109 |
110 |
111 |
112 | {this.state.sub}
113 | {this.state.buy}
114 | {this.state.sell}
115 |
116 |
117 | );
118 | }
119 | };
120 |
121 | export default class product extends Component {
122 | // 构造
123 | constructor(props) {
124 | super(props);
125 | // 初始状态
126 | this.state = {
127 | isRefreshing: false,
128 | loaded: 0,
129 | rowData: Array.from(new Array(20)).map(
130 | (val, i) => ({text: '初始行 ' + i}))
131 | };
132 | }
133 |
134 | render() {
135 | const rows = this.state.rowData.map((row, ii) => {
136 | return ;
137 | });
138 | return (
139 |
143 |
152 | }>
153 |
154 |
155 | 名称
156 | 买涨价
157 | 买跌价
158 |
159 | {rows}
160 |
161 |
162 |
163 | );
164 | }
165 |
166 | _onRefresh() {
167 | //this.state({
168 | // isRefreshing: true
169 | // }
170 | //)
171 | setTimeout(() => {
172 | // 准备下拉刷新的5条数据
173 | const rowData = Array.from(new Array(5))
174 | .map((val, i) => ({
175 | text: '刷新行 ' + (+this.state.loaded + i)
176 | }))
177 | .concat(this.state.rowData);
178 |
179 | this.setState({
180 | loaded: this.state.loaded + 5,
181 | isRefreshing: false,
182 | rowData: rowData,
183 | });
184 | }, 5000);
185 | }
186 | }
187 |
--------------------------------------------------------------------------------
/app/.deco/metadata/app/pages/Product.js.deco:
--------------------------------------------------------------------------------
1 | {
2 | "liveValues": [
3 | {
4 | "range": {
5 | "from": {
6 | "line": 21,
7 | "ch": 21
8 | },
9 | "to": {
10 | "line": 21,
11 | "ch": 40
12 | }
13 | },
14 | "editWith": "colorPicker",
15 | "type": "string",
16 | "name": "BorderColor"
17 | },
18 | {
19 | "range": {
20 | "from": {
21 | "line": 24,
22 | "ch": 25
23 | },
24 | "to": {
25 | "line": 24,
26 | "ch": 34
27 | }
28 | },
29 | "editWith": "colorPicker",
30 | "type": "string",
31 | "name": "BackgroundColor"
32 | },
33 | {
34 | "range": {
35 | "from": {
36 | "line": 26,
37 | "ch": 23
38 | },
39 | "to": {
40 | "line": 26,
41 | "ch": 31
42 | }
43 | },
44 | "editWith": "dropdown",
45 | "dropdownOptions": "FlexDirection",
46 | "type": "string",
47 | "name": "FlexDirection"
48 | },
49 | {
50 | "range": {
51 | "from": {
52 | "line": 36,
53 | "ch": 15
54 | },
55 | "to": {
56 | "line": 36,
57 | "ch": 21
58 | }
59 | },
60 | "editWith": "colorPicker",
61 | "type": "string",
62 | "name": "Color"
63 | },
64 | {
65 | "range": {
66 | "from": {
67 | "line": 40,
68 | "ch": 15
69 | },
70 | "to": {
71 | "line": 40,
72 | "ch": 21
73 | }
74 | },
75 | "editWith": "colorPicker",
76 | "type": "string",
77 | "name": "Color"
78 | },
79 | {
80 | "range": {
81 | "from": {
82 | "line": 79,
83 | "ch": 29
84 | },
85 | "to": {
86 | "line": 79,
87 | "ch": 36
88 | }
89 | },
90 | "editWith": "colorPicker",
91 | "type": "string",
92 | "name": "Color",
93 | "group": "TEXT"
94 | },
95 | {
96 | "range": {
97 | "from": {
98 | "line": 80,
99 | "ch": 32
100 | },
101 | "to": {
102 | "line": 80,
103 | "ch": 34
104 | }
105 | },
106 | "type": "number",
107 | "name": "FontSize",
108 | "group": "TEXT"
109 | },
110 | {
111 | "range": {
112 | "from": {
113 | "line": 81,
114 | "ch": 34
115 | },
116 | "to": {
117 | "line": 81,
118 | "ch": 42
119 | }
120 | },
121 | "editWith": "dropdown",
122 | "dropdownOptions": "FontWeight",
123 | "type": "string",
124 | "name": "FontWeight",
125 | "group": "TEXT"
126 | },
127 | {
128 | "range": {
129 | "from": {
130 | "line": 82,
131 | "ch": 34
132 | },
133 | "to": {
134 | "line": 82,
135 | "ch": 50
136 | }
137 | },
138 | "editWith": "dropdown",
139 | "dropdownOptions": "FontFamily",
140 | "type": "string",
141 | "name": "FontFamily",
142 | "group": "TEXT"
143 | },
144 | {
145 | "range": {
146 | "from": {
147 | "line": 106,
148 | "ch": 19
149 | },
150 | "to": {
151 | "line": 106,
152 | "ch": 21
153 | }
154 | },
155 | "type": "number",
156 | "name": "Padding",
157 | "group": "TOGGLE CONTAINER"
158 | },
159 | {
160 | "range": {
161 | "from": {
162 | "line": 107,
163 | "ch": 15
164 | },
165 | "to": {
166 | "line": 107,
167 | "ch": 27
168 | }
169 | },
170 | "editWith": "dropdown",
171 | "dropdownOptions": [
172 | "horizontal",
173 | "vertical"
174 | ],
175 | "type": "string",
176 | "name": "Orientation",
177 | "group": "TOGGLE CONTAINER"
178 | },
179 | {
180 | "range": {
181 | "from": {
182 | "line": 108,
183 | "ch": 11
184 | },
185 | "to": {
186 | "line": 108,
187 | "ch": 13
188 | }
189 | },
190 | "type": "number",
191 | "name": "Spacing",
192 | "group": "TOGGLE CONTAINER"
193 | },
194 | {
195 | "range": {
196 | "from": {
197 | "line": 114,
198 | "ch": 13
199 | },
200 | "to": {
201 | "line": 114,
202 | "ch": 30
203 | }
204 | },
205 | "editWith": "colorPicker",
206 | "type": "string",
207 | "name": "Color",
208 | "group": "TOGGLE ITEM"
209 | },
210 | {
211 | "range": {
212 | "from": {
213 | "line": 115,
214 | "ch": 23
215 | },
216 | "to": {
217 | "line": 115,
218 | "ch": 41
219 | }
220 | },
221 | "editWith": "colorPicker",
222 | "type": "string",
223 | "name": "BackgroundColor",
224 | "group": "TOGGLE ITEM"
225 | },
226 | {
227 | "range": {
228 | "from": {
229 | "line": 116,
230 | "ch": 19
231 | },
232 | "to": {
233 | "line": 116,
234 | "ch": 40
235 | }
236 | },
237 | "editWith": "colorPicker",
238 | "type": "string",
239 | "name": "BorderColor",
240 | "group": "TOGGLE ITEM"
241 | },
242 | {
243 | "range": {
244 | "from": {
245 | "line": 117,
246 | "ch": 19
247 | },
248 | "to": {
249 | "line": 117,
250 | "ch": 40
251 | }
252 | },
253 | "editWith": "colorPicker",
254 | "type": "string",
255 | "name": "ActiveColor",
256 | "group": "TOGGLE ITEM"
257 | },
258 | {
259 | "range": {
260 | "from": {
261 | "line": 118,
262 | "ch": 29
263 | },
264 | "to": {
265 | "line": 118,
266 | "ch": 46
267 | }
268 | },
269 | "editWith": "colorPicker",
270 | "type": "string",
271 | "name": "ActiveBackgroundColor",
272 | "group": "TOGGLE ITEM"
273 | },
274 | {
275 | "range": {
276 | "from": {
277 | "line": 119,
278 | "ch": 20
279 | },
280 | "to": {
281 | "line": 119,
282 | "ch": 21
283 | }
284 | },
285 | "type": "number",
286 | "name": "BorderRadius",
287 | "group": "TOGGLE ITEM"
288 | }
289 | ]
290 | }
--------------------------------------------------------------------------------
/app/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/app/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // the root of your project, i.e. where "package.json" lives
37 | * root: "../../",
38 | *
39 | * // where to put the JS bundle asset in debug mode
40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
41 | *
42 | * // where to put the JS bundle asset in release mode
43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
44 | *
45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
46 | * // require('./image.png')), in debug mode
47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
48 | *
49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
50 | * // require('./image.png')), in release mode
51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
52 | *
53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
57 | * // for example, you might want to remove it from here.
58 | * inputExcludes: ["android/**", "ios/**"],
59 | *
60 | * // override which node gets called and with what additional arguments
61 | * nodeExecutableAndArgs: ["node"]
62 | *
63 | * // supply additional arguments to the packager
64 | * extraPackagerArgs: []
65 | * ]
66 | */
67 |
68 | apply from: "../../node_modules/react-native/react.gradle"
69 |
70 | /**
71 | * Set this to true to create two separate APKs instead of one:
72 | * - An APK that only works on ARM devices
73 | * - An APK that only works on x86 devices
74 | * The advantage is the size of the APK is reduced by about 4MB.
75 | * Upload all the APKs to the Play Store and people will download
76 | * the correct one based on the CPU architecture of their device.
77 | */
78 | def enableSeparateBuildPerCPUArchitecture = false
79 |
80 | /**
81 | * Run Proguard to shrink the Java bytecode in release builds.
82 | */
83 | def enableProguardInReleaseBuilds = false
84 |
85 | android {
86 | compileSdkVersion 23
87 | buildToolsVersion "23.0.1"
88 |
89 | defaultConfig {
90 | applicationId "com.app"
91 | minSdkVersion 16
92 | targetSdkVersion 22
93 | versionCode 1
94 | versionName "1.0"
95 | ndk {
96 | abiFilters "armeabi-v7a", "x86"
97 | }
98 | }
99 | splits {
100 | abi {
101 | reset()
102 | enable enableSeparateBuildPerCPUArchitecture
103 | universalApk false // If true, also generate a universal APK
104 | include "armeabi-v7a", "x86"
105 | }
106 | }
107 | buildTypes {
108 | release {
109 | minifyEnabled enableProguardInReleaseBuilds
110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
111 | }
112 | }
113 | // applicationVariants are e.g. debug, release
114 | applicationVariants.all { variant ->
115 | variant.outputs.each { output ->
116 | // For each separate APK per architecture, set a unique version code as described here:
117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
118 | def versionCodes = ["armeabi-v7a":1, "x86":2]
119 | def abi = output.getFilter(OutputFile.ABI)
120 | if (abi != null) { // null for the universal-debug, universal-release variants
121 | output.versionCodeOverride =
122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
123 | }
124 | }
125 | }
126 | }
127 |
128 | dependencies {
129 | compile project(':react-native-device-info')
130 | compile fileTree(dir: "libs", include: ["*.jar"])
131 | compile "com.android.support:appcompat-v7:23.0.1"
132 | compile "com.facebook.react:react-native:+" // From node_modules
133 | }
134 |
135 | // Run this once to be able to run the application with BUCK
136 | // puts all compile dependencies into folder libs for BUCK to use
137 | task copyDownloadableDepsToLibs(type: Copy) {
138 | from configurations.compile
139 | into 'libs'
140 | }
141 |
--------------------------------------------------------------------------------
/app/.vscode/typings/react/react-addons-test-utils.d.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for React v0.14 (react-addons-test-utils)
2 | // Project: http://facebook.github.io/react/
3 | // Definitions by: Asana , AssureSign , Microsoft
4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped
5 |
6 | ///
7 |
8 | declare namespace __React {
9 | interface SyntheticEventData {
10 | altKey?: boolean;
11 | button?: number;
12 | buttons?: number;
13 | clientX?: number;
14 | clientY?: number;
15 | changedTouches?: TouchList;
16 | charCode?: boolean;
17 | clipboardData?: DataTransfer;
18 | ctrlKey?: boolean;
19 | deltaMode?: number;
20 | deltaX?: number;
21 | deltaY?: number;
22 | deltaZ?: number;
23 | detail?: number;
24 | getModifierState?(key: string): boolean;
25 | key?: string;
26 | keyCode?: number;
27 | locale?: string;
28 | location?: number;
29 | metaKey?: boolean;
30 | pageX?: number;
31 | pageY?: number;
32 | relatedTarget?: EventTarget;
33 | repeat?: boolean;
34 | screenX?: number;
35 | screenY?: number;
36 | shiftKey?: boolean;
37 | targetTouches?: TouchList;
38 | touches?: TouchList;
39 | view?: AbstractView;
40 | which?: number;
41 | }
42 |
43 | interface EventSimulator {
44 | (element: Element, eventData?: SyntheticEventData): void;
45 | (component: Component, eventData?: SyntheticEventData): void;
46 | }
47 |
48 | interface MockedComponentClass {
49 | new(): any;
50 | }
51 |
52 | class ShallowRenderer {
53 | getRenderOutput>(): E;
54 | getRenderOutput(): ReactElement;
55 | render(element: ReactElement, context?: any): void;
56 | unmount(): void;
57 | }
58 |
59 | namespace __Addons {
60 | namespace TestUtils {
61 | namespace Simulate {
62 | export var blur: EventSimulator;
63 | export var change: EventSimulator;
64 | export var click: EventSimulator;
65 | export var cut: EventSimulator;
66 | export var doubleClick: EventSimulator;
67 | export var drag: EventSimulator;
68 | export var dragEnd: EventSimulator;
69 | export var dragEnter: EventSimulator;
70 | export var dragExit: EventSimulator;
71 | export var dragLeave: EventSimulator;
72 | export var dragOver: EventSimulator;
73 | export var dragStart: EventSimulator;
74 | export var drop: EventSimulator;
75 | export var focus: EventSimulator;
76 | export var input: EventSimulator;
77 | export var keyDown: EventSimulator;
78 | export var keyPress: EventSimulator;
79 | export var keyUp: EventSimulator;
80 | export var mouseDown: EventSimulator;
81 | export var mouseEnter: EventSimulator;
82 | export var mouseLeave: EventSimulator;
83 | export var mouseMove: EventSimulator;
84 | export var mouseOut: EventSimulator;
85 | export var mouseOver: EventSimulator;
86 | export var mouseUp: EventSimulator;
87 | export var paste: EventSimulator;
88 | export var scroll: EventSimulator;
89 | export var submit: EventSimulator;
90 | export var touchCancel: EventSimulator;
91 | export var touchEnd: EventSimulator;
92 | export var touchMove: EventSimulator;
93 | export var touchStart: EventSimulator;
94 | export var wheel: EventSimulator;
95 | }
96 |
97 | export function renderIntoDocument(
98 | element: DOMElement): Element;
99 | export function renderIntoDocument(
100 | element: ReactElement
): Component
;
101 | export function renderIntoDocument>(
102 | element: ReactElement): C;
103 |
104 | export function mockComponent(
105 | mocked: MockedComponentClass, mockTagName?: string): typeof TestUtils;
106 |
107 | export function isElementOfType(
108 | element: ReactElement, type: ReactType): boolean;
109 | export function isDOMComponent(instance: ReactInstance): boolean;
110 | export function isCompositeComponent(instance: ReactInstance): boolean;
111 | export function isCompositeComponentWithType(
112 | instance: ReactInstance,
113 | type: ComponentClass): boolean;
114 |
115 | export function findAllInRenderedTree(
116 | root: Component,
117 | fn: (i: ReactInstance) => boolean): ReactInstance[];
118 |
119 | export function scryRenderedDOMComponentsWithClass(
120 | root: Component,
121 | className: string): Element[];
122 | export function findRenderedDOMComponentWithClass(
123 | root: Component,
124 | className: string): Element;
125 |
126 | export function scryRenderedDOMComponentsWithTag(
127 | root: Component,
128 | tagName: string): Element[];
129 | export function findRenderedDOMComponentWithTag(
130 | root: Component,
131 | tagName: string): Element;
132 |
133 | export function scryRenderedComponentsWithType(
134 | root: Component,
135 | type: ComponentClass): Component
[];
136 | export function scryRenderedComponentsWithType>(
137 | root: Component,
138 | type: ComponentClass): C[];
139 |
140 | export function findRenderedComponentWithType(
141 | root: Component,
142 | type: ComponentClass): Component
;
143 | export function findRenderedComponentWithType>(
144 | root: Component,
145 | type: ComponentClass): C;
146 |
147 | export function createRenderer(): ShallowRenderer;
148 | }
149 | }
150 | }
151 |
152 | declare module "react-addons-test-utils" {
153 | import TestUtils = __React.__Addons.TestUtils;
154 | export = TestUtils;
155 | }
156 |
--------------------------------------------------------------------------------
/image 组件.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | Image,
11 | StyleSheet,
12 | Text,
13 | View,
14 | ListView,
15 | PixelRatio,
16 | TouchableOpacity,
17 | Navigator,
18 | ScrollView,TextInput,TouchableHighlight,
19 | } from 'react-native';
20 | var onePT = 1 / PixelRatio.get(); //最小的像素密度
21 | const Header = require('./header');
22 | var imgs = ['http://www.baidu.com/img/bd_logo1.png',
23 | 'http://c.hiphotos.baidu.com/image/h%3D200/sign=89c6743711ce36d3bd0484300af23a24/ae51f3deb48f8c54469d4dc23e292df5e1fe7f95.jpg',
24 | 'http://e.hiphotos.baidu.com/image/h%3D200/sign=5f6ab3f5d00735fa8ef049b9ae500f9f/29381f30e924b8995d7368d66a061d950b7bf695.jpg',
25 | 'http://g.hiphotos.baidu.com/image/pic/item/96dda144ad345982f4c3f47c08f431adcaef8496.jpg'];
26 | class AwesomeProject extends Component {
27 |
28 | render() {
29 | return (
30 |
31 |
32 |
33 | );
34 | }
35 |
36 | }
37 | class MyImage extends Component {
38 | // 构造
39 | constructor(props) {
40 | super(props);
41 | // 初始状态
42 | this.state = {
43 | count: 0,
44 | imgs: this.props.imgs
45 | };
46 | }
47 |
48 | goPreview() {
49 | var count = this.state.count;
50 | count--;
51 | if (count > 0) {
52 | this.setState({
53 | count: count
54 |
55 | })
56 |
57 | }
58 | }
59 |
60 | goNext() {
61 | var count = this.state.count;
62 | count++;
63 | console.log(this.state.imgs.size)
64 | if (count < this.state.imgs.size) {
65 | this.setState({
66 | count: count
67 |
68 | })
69 | }
70 | }
71 |
72 | render() {
73 | return (
74 |
75 |
78 |
79 |
80 |
81 |
82 |
83 | 上一张
84 |
85 |
86 | 下一张
87 |
88 |
89 | );
90 | }
91 | }
92 | class HightComponet extends Component {
93 | show(val) {
94 | alert(val);
95 | }
96 |
97 | render() {
98 | return (
99 |
100 |
101 | 欢迎学习
102 |
103 |
104 | 欢迎学习
105 |
106 |
107 | 欢迎学习
108 |
109 |
110 | )
111 | }
112 |
113 | }
114 | class SearchText extends Component {
115 |
116 |
117 | // 构造
118 | constructor(props) {
119 | super(props);
120 | // 初始状态
121 | this.state = {
122 | show: false,
123 | value: null
124 | };
125 | }
126 |
127 | hide(val) {
128 | this.setState({
129 | show: false,
130 | value: val
131 | })
132 | }
133 |
134 | getValue(text) {
135 | this.setState({
136 | show: true,
137 | value: text
138 | });
139 | }
140 |
141 | render() {
142 | return (
143 |
144 |
145 |
151 |
152 |
153 |
154 | 搜索
155 |
156 |
157 |
158 |
159 | {
160 | this.state.show ?
161 |
162 |
164 | {this.state.value}加我 QQ
165 |
166 |
168 | {this.state.value}加我 QQ
169 |
170 |
172 | {this.state.value}加我 QQ
173 |
174 |
176 | {this.state.value}加我 QQ
177 |
178 | : null
179 | }
180 |
181 |
182 | );
183 | }
184 | }
185 |
186 | class Detail extends Component {
187 | // 构造
188 | constructor(props) {
189 | super(props);
190 | // 初始状态
191 | this.state = {};
192 | }
193 |
194 | _pressButton() {
195 | const {navigator }= this.props;
196 | if (navigator) {
197 | navigator.pop();
198 | }
199 |
200 | }
201 |
202 | render() {
203 | return (
204 | 点我可以弹回去
205 | );
206 | }
207 | }
208 | const styles = StyleSheet.create({
209 | container: {
210 | marginTop: 200,
211 | marginLeft: 5,
212 | marginRight: 5,
213 | height: 84,
214 | flexDirection: 'row',
215 | borderRadius: 5,
216 | padding: 2,
217 | backgroundColor: '#FF0067',
218 |
219 | },
220 | list_item: {
221 | height: 40,
222 | marginLeft: 10,
223 | marginRight: 10,
224 | borderBottomWidth: 1,
225 | borderBottomColor: "#ddd",
226 | justifyContent: 'center',
227 | },
228 | list_item_font: {
229 | fontSize: 16,
230 | },
231 | new_title: {
232 | fontSize: 20,
233 | fontWeight: 'bold',
234 | color: '#CD1D1C',
235 | marginLeft: 10,
236 | marginTop: 15
237 | },
238 | news_item: {
239 | marginLeft: 10,
240 | marginRight: 10,
241 | fontSize: 15,
242 | lineHeight: 40
243 | },
244 | flex: {
245 | flex: 1
246 | },
247 | flexDirection: {
248 | flexDirection: 'row'
249 | },
250 | topStatus: {
251 | marginTop: 25
252 | },
253 | input: {
254 | height: 45,
255 | borderColor: 'red',
256 | borderWidth: 1,
257 | marginLeft: 10,
258 | paddingLeft: 10,
259 | borderRadius: 5
260 | },
261 | btn: {
262 | width: 45,
263 | marginLeft: -5,
264 | marginRight: 5,
265 | backgroundColor: '#23BEFF',
266 | height: 50,
267 | justifyContent: 'center',
268 | alignItems: 'center'
269 | },
270 | search: {
271 | color: '#fff',
272 | fontSize: 15,
273 | fontWeight: 'bold'
274 | },
275 | topStatus: {},
276 | flexDirection: {
277 | flexDirection: 'row'
278 | },
279 | btns: {
280 | flexDirection: 'row',
281 | marginTop: 20,
282 | justifyContent: 'center'
283 | },
284 | img: {
285 | height: 150,
286 | width: 300,
287 | borderRadius:5,
288 | resizeMode : 'cover'
289 |
290 | },
291 | image: {
292 | borderWidth: 1,
293 | height: 150,
294 | width: 300,
295 | justifyContent:'center',
296 | marginLeft:30,
297 | marginRight:30
298 | }
299 |
300 |
301 | });
302 |
303 | AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
304 |
--------------------------------------------------------------------------------
/Android原生项目移植 ReactNative.md:
--------------------------------------------------------------------------------
1 | # 1.在原有 Android 项目中嵌入 ReactNative 模块
2 |
3 | >ReactNative的发展已经进入了很多开发者视野,作为一名原生开发者更是对 RN 充满了无限的好奇和期待,
4 | 本节将详细讲述如何将一个原生的 Android App 项目嵌入最新的 RN 模块
5 |
6 |
7 |
8 | ## 1. 准备开始
9 |
10 | 1. 一个已有的 Android 原生项目
11 | 2. 已经配置好的原生 Android 开发环境和 node.js已经 RN 环境
12 | 3. 改造之后的流程图
13 | 
14 |
15 | ## 2.开始改造
16 | 1. *在原生 Android 项目的在app/build.gradle文件中,添加React Native依赖:*
17 |
18 |
19 | ```
20 | compile"com.facebook.react:react-native:+
21 | ```
22 |
23 | 2. *加入.so 库*
24 |
25 | ```
26 | ndk {
27 | abiFilters "armeabi-v7a", "x86"
28 | }
29 | ```
30 |
31 | 3. *在工程目录下找到工程的 build.gradle文件中,添加 maven依赖*
32 |
33 | ```
34 | allprojects {
35 | repositories {
36 | jcenter()
37 | maven {
38 | // All of React Native (JS, Android binaries) is installed from npm
39 | url "$rootDir/node_modules/react-native/android"
40 | }
41 | }
42 | }
43 | ```
44 |
45 | 3. 在 app 目录里添加需要的权限
46 | ```
47 |
48 | /**设置调试 的权限**/
49 |
50 | ```
51 | 4.添加 FaceBook 的 ReactNative 调试的 activity
52 | ```
53 |
54 | ```
55 | # 2. 编写原生的 ReactNative 模块 ,废话不多说,直接上代码
56 |
57 | ```java
58 | package com.allen.reactapp;
59 |
60 | import android.app.Activity;
61 | import android.os.Bundle;
62 |
63 | import com.facebook.react.LifecycleState;
64 | import com.facebook.react.ReactInstanceManager;
65 | import com.facebook.react.ReactRootView;
66 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
67 | import com.facebook.react.shell.MainReactPackage;
68 |
69 | /**
70 | * 作者: allen on 16/7/31.
71 | */
72 | public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler {
73 | private ReactRootView mReactRootView;
74 | private ReactInstanceManager mReactInstanceManager;
75 |
76 | @Override
77 | protected void onCreate(Bundle savedInstanceState) {
78 | super.onCreate(savedInstanceState);
79 |
80 | mReactRootView = new ReactRootView(this);
81 | mReactInstanceManager = ReactInstanceManager.builder()
82 | .setApplication(getApplication())
83 | .setBundleAssetName("index.android.bundle")
84 | .setJSMainModuleName("index.android")
85 | .addPackage(new MainReactPackage())
86 | /**
87 | * http://stackoverflow.com/questions/37951246/react-native-cannot-find-development-server-integrating-existing-android-app
88 | * 调试模式下,建议直接写成 true 吧,我就因为这个错误,调了两天原因
89 | */
90 | // .setUseDeveloperSupport(BuildConfig.DEBUG)
91 | .setUseDeveloperSupport(true)
92 | .setInitialLifecycleState(LifecycleState.RESUMED)
93 | .build();
94 | mReactRootView.startReactApplication(mReactInstanceManager, "myreactactivity", null);
95 |
96 | setContentView(mReactRootView);
97 | }
98 |
99 | @Override
100 | public void invokeDefaultOnBackPressed() {
101 | super.onBackPressed();
102 | }
103 | @Override
104 | protected void onPause() {
105 | super.onPause();
106 |
107 | if (mReactInstanceManager != null) {
108 | mReactInstanceManager.onHostPause();
109 | }
110 | }
111 |
112 | @Override
113 | protected void onResume() {
114 | super.onResume();
115 |
116 | if (mReactInstanceManager != null) {
117 | mReactInstanceManager.onHostResume(this, this);
118 | }
119 | }
120 |
121 | @Override
122 | public void onBackPressed() {
123 | if (mReactInstanceManager != null) {
124 | mReactInstanceManager.onBackPressed();
125 | } else {
126 | super.onBackPressed();
127 | }
128 | }
129 |
130 |
131 | }
132 |
133 |
134 |
135 | ```
136 |
137 | ## 到此为止我们的Android项目Activity和配置文件以及完成了最基本的配置方法了。
138 |
139 |
140 | ========================================================================
141 |
142 | ========================================================================
143 | # 3. 下面配置工程项目的 RN开发环境
144 | 1. 先后顺序依次执行一下命令
145 | ```
146 | $ npm init
147 | ```
148 | >该命令会创建一个package.json文件,并且提示我们输入一些信息,默认不输入即可,不过name必须要为全英文小写哦,
149 |
150 | ##然后再依次去执行以下命令
151 | ```
152 | $ npm install --save react
153 | $ npm install --save react-native
154 | $ curl -o .flowconfig https://raw.githubusercontent.com/facebook/react-native/master/.flowconfig
155 | ```
156 |
157 | 创建完成后,去工程目录下修改 *package.json*
158 | 在scripts标签那边添加如下代码:
159 | ```
160 | "start":"node_modules/react-native/packager/packager.sh"
161 | ```
162 | 
163 | # 3. 工程目录下创建 index.android.js 由于是测试代码直接 Copy FaceBook 的源码
164 | ```
165 |
166 |
167 | /**
168 | * Sample React Native App
169 | * https://github.com/facebook/react-native
170 | * @flow
171 | */
172 |
173 | import React, { Component } from 'react';
174 | import {
175 | AppRegistry,
176 | StyleSheet,
177 | Text,
178 | View
179 | } from 'react-native';
180 |
181 | class AwesomeProject extends Component {
182 | render() {
183 | return (
184 |
185 |
186 | Welcome to React Native!
187 |
188 |
189 | 我是 原生项目嵌入的 ReactNative
190 |
191 |
192 | Press Cmd+R to reload,{'\n'}
193 | Cmd+D or shake for dev menu
194 |
195 |
196 | );
197 | }
198 | }
199 |
200 | const styles = StyleSheet.create({
201 | container: {
202 | flex: 1,
203 | justifyContent: 'center',
204 | alignItems: 'center',
205 | backgroundColor: '#F5FCFF',
206 | },
207 | welcome: {
208 | fontSize: 20,
209 | textAlign: 'center',
210 | margin: 10,
211 | },
212 | instructions: {
213 | textAlign: 'center',
214 | color: '#333333',
215 | marginBottom: 5,
216 | },
217 | });
218 |
219 | AppRegistry.registerComponent('myreactactivity', () => AwesomeProject);
220 |
221 |
222 | ```
223 |
224 | > 注意:此处需要修改注册的入口 保持一致,我的是 *my_react_activity*
225 |
226 | # 4.检查以上所有步骤,有无遗漏,如果正常,接下来就可以顺利的运行你的混合 APP 了,如果还不行,你需要检查你的姿势是否正确?
227 |
228 | 运行你的 APP
229 |
230 | 1. 在项目的工程路径运行以下命令来启动你的开发服务器
231 |
232 | ```
233 | react-native start
234 | ```
235 | 或者执行
236 |
237 | ```
238 | npm start
239 | ```
240 | 2. android studio 调试你的 APP
241 | 3. 演示效果图
242 |
243 |
244 |
245 | ===================
246 |
247 |
248 |
249 | ## 错误解决:
250 |
251 | ```
252 | Process: com.allen.reactapp, PID: 20469
253 | java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server.
254 | Try the following to fix the issue:
255 | Ensure that the packager server is running
256 | Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices
257 | If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device
258 | If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to y
259 | at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:911)
260 | at com.facebook.react.ReactInstanceManagerImpl.access$700(ReactInstanceManagerImpl.java:100)
261 | at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:197)
262 | at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:180)
263 | at android.os.AsyncTask$2.call(AsyncTask.java:295)
264 | at java.util.concurrent.FutureTask.run(FutureTask.java:237)
265 | at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
266 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
267 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
268 | at java.lang.Thread.run(Thread.java:818)
269 | Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not connect to development server.
270 | Try the following to fix the issue:
271 | Ensure that the packager server is running
272 | Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices
273 | If you're on a physical device connected to the same machine, run 'adb reverse tcp:8081 tcp:8081' to forward requests from your device
274 | If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to y
275 | at com.facebook.react.common.futures.SimpleSettableFuture.get(SimpleSettableFuture.java:68)
276 | at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:882)
277 | ... 9 more
278 | Caused by: java.lang.RuntimeException: Could not connect to development server.
279 | Try the following to fix the issue:
280 | Ensure that the packager server is running
281 | Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices
282 | ```
283 | > 解决办法:
284 | > .setUseDeveloperSupport(true) *调试模式下,建议直接写成 true 吧,*
285 |
286 | 签名打包混合 APP
287 | 1. 将 js 文件存入 bundle 一起打包
288 | 执行命令:
289 | ```
290 | curl -k "http://localhost:8081/index.android.bundle"> reactapp/src/main/assets/index.android.bundle
291 | ```
292 | 执行完命令成功,在 assets目录应该看到 index.android.bundle文件
293 |
294 | Android studio 执行打包过程,作为一名 Android 老司机我就不再具体描述了
295 | > [原 Android 移植 React Native 项目地址](https://github.com/AllenCoder/AndroidDevCoder/tree/master/reactapp)
--------------------------------------------------------------------------------
/app/ios/app.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 | /* Begin PBXBuildFile section */
9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
14 | 00E356F31AD99517003FC87E /* appTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* appTests.m */; };
15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
22 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
25 | 9F53BADF1D3BD37200CA2CB2 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB61A68108700A75B9A /* Info.plist */; };
26 | A57D426D200E40B8AD794162 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1163C0F728BC4697AE7A8B3F /* libRNDeviceInfo.a */; };
27 | /* End PBXBuildFile section */
28 |
29 | /* Begin PBXContainerItemProxy section */
30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
33 | proxyType = 2;
34 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
35 | remoteInfo = RCTActionSheet;
36 | };
37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
38 | isa = PBXContainerItemProxy;
39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
40 | proxyType = 2;
41 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
42 | remoteInfo = RCTGeolocation;
43 | };
44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
45 | isa = PBXContainerItemProxy;
46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
47 | proxyType = 2;
48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
49 | remoteInfo = RCTImage;
50 | };
51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
52 | isa = PBXContainerItemProxy;
53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
54 | proxyType = 2;
55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
56 | remoteInfo = RCTNetwork;
57 | };
58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
59 | isa = PBXContainerItemProxy;
60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
61 | proxyType = 2;
62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
63 | remoteInfo = RCTVibration;
64 | };
65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
66 | isa = PBXContainerItemProxy;
67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
68 | proxyType = 1;
69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
70 | remoteInfo = app;
71 | };
72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
73 | isa = PBXContainerItemProxy;
74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
75 | proxyType = 2;
76 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
77 | remoteInfo = RCTSettings;
78 | };
79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
80 | isa = PBXContainerItemProxy;
81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
82 | proxyType = 2;
83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
84 | remoteInfo = RCTWebSocket;
85 | };
86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
87 | isa = PBXContainerItemProxy;
88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
89 | proxyType = 2;
90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
91 | remoteInfo = React;
92 | };
93 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
94 | isa = PBXContainerItemProxy;
95 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
96 | proxyType = 2;
97 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
98 | remoteInfo = RCTLinking;
99 | };
100 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
101 | isa = PBXContainerItemProxy;
102 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
103 | proxyType = 2;
104 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
105 | remoteInfo = RCTText;
106 | };
107 | /* End PBXContainerItemProxy section */
108 |
109 | /* Begin PBXFileReference section */
110 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
111 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
112 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
113 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
114 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
115 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
116 | 00E356EE1AD99517003FC87E /* appTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = appTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
117 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
118 | 00E356F21AD99517003FC87E /* appTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = appTests.m; sourceTree = ""; };
119 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
120 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
121 | 13B07F961A680F5B00A75B9A /* app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app.app; sourceTree = BUILT_PRODUCTS_DIR; };
122 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = app/AppDelegate.h; sourceTree = ""; };
123 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = app/AppDelegate.m; sourceTree = ""; };
124 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
125 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = app/Images.xcassets; sourceTree = ""; };
126 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = app/Info.plist; sourceTree = ""; };
127 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = app/main.m; sourceTree = ""; };
128 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
129 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
130 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
131 | 11C18AB188AB4B729AEB052B /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/RNDeviceInfo.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
132 | 1163C0F728BC4697AE7A8B3F /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
133 | /* End PBXFileReference section */
134 |
135 | /* Begin PBXFrameworksBuildPhase section */
136 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
137 | isa = PBXFrameworksBuildPhase;
138 | buildActionMask = 2147483647;
139 | files = (
140 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
141 | );
142 | runOnlyForDeploymentPostprocessing = 0;
143 | };
144 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
145 | isa = PBXFrameworksBuildPhase;
146 | buildActionMask = 2147483647;
147 | files = (
148 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
149 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
150 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
151 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
152 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
153 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
154 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
155 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
156 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
157 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
158 | A57D426D200E40B8AD794162 /* libRNDeviceInfo.a in Frameworks */,
159 | );
160 | runOnlyForDeploymentPostprocessing = 0;
161 | };
162 | /* End PBXFrameworksBuildPhase section */
163 |
164 | /* Begin PBXGroup section */
165 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
166 | isa = PBXGroup;
167 | children = (
168 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
169 | );
170 | name = Products;
171 | sourceTree = "";
172 | };
173 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
174 | isa = PBXGroup;
175 | children = (
176 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
177 | );
178 | name = Products;
179 | sourceTree = "";
180 | };
181 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
182 | isa = PBXGroup;
183 | children = (
184 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
185 | );
186 | name = Products;
187 | sourceTree = "";
188 | };
189 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
190 | isa = PBXGroup;
191 | children = (
192 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
193 | );
194 | name = Products;
195 | sourceTree = "";
196 | };
197 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
198 | isa = PBXGroup;
199 | children = (
200 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
201 | );
202 | name = Products;
203 | sourceTree = "";
204 | };
205 | 00E356EF1AD99517003FC87E /* appTests */ = {
206 | isa = PBXGroup;
207 | children = (
208 | 00E356F21AD99517003FC87E /* appTests.m */,
209 | 00E356F01AD99517003FC87E /* Supporting Files */,
210 | );
211 | path = appTests;
212 | sourceTree = "";
213 | };
214 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
215 | isa = PBXGroup;
216 | children = (
217 | 00E356F11AD99517003FC87E /* Info.plist */,
218 | );
219 | name = "Supporting Files";
220 | sourceTree = "";
221 | };
222 | 139105B71AF99BAD00B5F7CC /* Products */ = {
223 | isa = PBXGroup;
224 | children = (
225 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
226 | );
227 | name = Products;
228 | sourceTree = "";
229 | };
230 | 139FDEE71B06529A00C62182 /* Products */ = {
231 | isa = PBXGroup;
232 | children = (
233 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
234 | );
235 | name = Products;
236 | sourceTree = "";
237 | };
238 | 13B07FAE1A68108700A75B9A /* app */ = {
239 | isa = PBXGroup;
240 | children = (
241 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
242 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
243 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
244 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
245 | 13B07FB61A68108700A75B9A /* Info.plist */,
246 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
247 | 13B07FB71A68108700A75B9A /* main.m */,
248 | );
249 | name = app;
250 | sourceTree = "";
251 | };
252 | 146834001AC3E56700842450 /* Products */ = {
253 | isa = PBXGroup;
254 | children = (
255 | 146834041AC3E56700842450 /* libReact.a */,
256 | );
257 | name = Products;
258 | sourceTree = "";
259 | };
260 | 78C398B11ACF4ADC00677621 /* Products */ = {
261 | isa = PBXGroup;
262 | children = (
263 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
264 | );
265 | name = Products;
266 | sourceTree = "";
267 | };
268 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
269 | isa = PBXGroup;
270 | children = (
271 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
272 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
273 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
274 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
275 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
276 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
277 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
278 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
279 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
280 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
281 | 11C18AB188AB4B729AEB052B /* RNDeviceInfo.xcodeproj */,
282 | );
283 | name = Libraries;
284 | sourceTree = "";
285 | };
286 | 832341B11AAA6A8300B99B32 /* Products */ = {
287 | isa = PBXGroup;
288 | children = (
289 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
290 | );
291 | name = Products;
292 | sourceTree = "";
293 | };
294 | 83CBB9F61A601CBA00E9B192 = {
295 | isa = PBXGroup;
296 | children = (
297 | 13B07FAE1A68108700A75B9A /* app */,
298 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
299 | 00E356EF1AD99517003FC87E /* appTests */,
300 | 83CBBA001A601CBA00E9B192 /* Products */,
301 | );
302 | indentWidth = 2;
303 | sourceTree = "";
304 | tabWidth = 2;
305 | };
306 | 83CBBA001A601CBA00E9B192 /* Products */ = {
307 | isa = PBXGroup;
308 | children = (
309 | 13B07F961A680F5B00A75B9A /* app.app */,
310 | 00E356EE1AD99517003FC87E /* appTests.xctest */,
311 | );
312 | name = Products;
313 | sourceTree = "";
314 | };
315 | /* End PBXGroup section */
316 |
317 | /* Begin PBXNativeTarget section */
318 | 00E356ED1AD99517003FC87E /* appTests */ = {
319 | isa = PBXNativeTarget;
320 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "appTests" */;
321 | buildPhases = (
322 | 00E356EA1AD99517003FC87E /* Sources */,
323 | 00E356EB1AD99517003FC87E /* Frameworks */,
324 | 00E356EC1AD99517003FC87E /* Resources */,
325 | );
326 | buildRules = (
327 | );
328 | dependencies = (
329 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
330 | );
331 | name = appTests;
332 | productName = appTests;
333 | productReference = 00E356EE1AD99517003FC87E /* appTests.xctest */;
334 | productType = "com.apple.product-type.bundle.unit-test";
335 | };
336 | 13B07F861A680F5B00A75B9A /* app */ = {
337 | isa = PBXNativeTarget;
338 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "app" */;
339 | buildPhases = (
340 | 13B07F871A680F5B00A75B9A /* Sources */,
341 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
342 | 13B07F8E1A680F5B00A75B9A /* Resources */,
343 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
344 | );
345 | buildRules = (
346 | );
347 | dependencies = (
348 | );
349 | name = app;
350 | productName = "Hello World";
351 | productReference = 13B07F961A680F5B00A75B9A /* app.app */;
352 | productType = "com.apple.product-type.application";
353 | };
354 | /* End PBXNativeTarget section */
355 |
356 | /* Begin PBXProject section */
357 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
358 | isa = PBXProject;
359 | attributes = {
360 | LastUpgradeCheck = 610;
361 | ORGANIZATIONNAME = Facebook;
362 | TargetAttributes = {
363 | 00E356ED1AD99517003FC87E = {
364 | CreatedOnToolsVersion = 6.2;
365 | TestTargetID = 13B07F861A680F5B00A75B9A;
366 | };
367 | };
368 | };
369 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "app" */;
370 | compatibilityVersion = "Xcode 3.2";
371 | developmentRegion = English;
372 | hasScannedForEncodings = 0;
373 | knownRegions = (
374 | en,
375 | Base,
376 | );
377 | mainGroup = 83CBB9F61A601CBA00E9B192;
378 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
379 | projectDirPath = "";
380 | projectReferences = (
381 | {
382 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
383 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
384 | },
385 | {
386 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
387 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
388 | },
389 | {
390 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
391 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
392 | },
393 | {
394 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
395 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
396 | },
397 | {
398 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
399 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
400 | },
401 | {
402 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
403 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
404 | },
405 | {
406 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
407 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
408 | },
409 | {
410 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
411 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
412 | },
413 | {
414 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
415 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
416 | },
417 | {
418 | ProductGroup = 146834001AC3E56700842450 /* Products */;
419 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
420 | },
421 | );
422 | projectRoot = "";
423 | targets = (
424 | 13B07F861A680F5B00A75B9A /* app */,
425 | 00E356ED1AD99517003FC87E /* appTests */,
426 | );
427 | };
428 | /* End PBXProject section */
429 |
430 | /* Begin PBXReferenceProxy section */
431 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
432 | isa = PBXReferenceProxy;
433 | fileType = archive.ar;
434 | path = libRCTActionSheet.a;
435 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
436 | sourceTree = BUILT_PRODUCTS_DIR;
437 | };
438 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
439 | isa = PBXReferenceProxy;
440 | fileType = archive.ar;
441 | path = libRCTGeolocation.a;
442 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
443 | sourceTree = BUILT_PRODUCTS_DIR;
444 | };
445 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
446 | isa = PBXReferenceProxy;
447 | fileType = archive.ar;
448 | path = libRCTImage.a;
449 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
450 | sourceTree = BUILT_PRODUCTS_DIR;
451 | };
452 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
453 | isa = PBXReferenceProxy;
454 | fileType = archive.ar;
455 | path = libRCTNetwork.a;
456 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
457 | sourceTree = BUILT_PRODUCTS_DIR;
458 | };
459 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
460 | isa = PBXReferenceProxy;
461 | fileType = archive.ar;
462 | path = libRCTVibration.a;
463 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
464 | sourceTree = BUILT_PRODUCTS_DIR;
465 | };
466 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
467 | isa = PBXReferenceProxy;
468 | fileType = archive.ar;
469 | path = libRCTSettings.a;
470 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
471 | sourceTree = BUILT_PRODUCTS_DIR;
472 | };
473 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
474 | isa = PBXReferenceProxy;
475 | fileType = archive.ar;
476 | path = libRCTWebSocket.a;
477 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
478 | sourceTree = BUILT_PRODUCTS_DIR;
479 | };
480 | 146834041AC3E56700842450 /* libReact.a */ = {
481 | isa = PBXReferenceProxy;
482 | fileType = archive.ar;
483 | path = libReact.a;
484 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
485 | sourceTree = BUILT_PRODUCTS_DIR;
486 | };
487 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
488 | isa = PBXReferenceProxy;
489 | fileType = archive.ar;
490 | path = libRCTLinking.a;
491 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
492 | sourceTree = BUILT_PRODUCTS_DIR;
493 | };
494 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
495 | isa = PBXReferenceProxy;
496 | fileType = archive.ar;
497 | path = libRCTText.a;
498 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
499 | sourceTree = BUILT_PRODUCTS_DIR;
500 | };
501 | /* End PBXReferenceProxy section */
502 |
503 | /* Begin PBXResourcesBuildPhase section */
504 | 00E356EC1AD99517003FC87E /* Resources */ = {
505 | isa = PBXResourcesBuildPhase;
506 | buildActionMask = 2147483647;
507 | files = (
508 | );
509 | runOnlyForDeploymentPostprocessing = 0;
510 | };
511 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
512 | isa = PBXResourcesBuildPhase;
513 | buildActionMask = 2147483647;
514 | files = (
515 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
516 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
517 | 9F53BADF1D3BD37200CA2CB2 /* Info.plist in Resources */,
518 | );
519 | runOnlyForDeploymentPostprocessing = 0;
520 | };
521 | /* End PBXResourcesBuildPhase section */
522 |
523 | /* Begin PBXShellScriptBuildPhase section */
524 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
525 | isa = PBXShellScriptBuildPhase;
526 | buildActionMask = 2147483647;
527 | files = (
528 | );
529 | inputPaths = (
530 | );
531 | name = "Bundle React Native code and images";
532 | outputPaths = (
533 | );
534 | runOnlyForDeploymentPostprocessing = 0;
535 | shellPath = /bin/sh;
536 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
537 | };
538 | /* End PBXShellScriptBuildPhase section */
539 |
540 | /* Begin PBXSourcesBuildPhase section */
541 | 00E356EA1AD99517003FC87E /* Sources */ = {
542 | isa = PBXSourcesBuildPhase;
543 | buildActionMask = 2147483647;
544 | files = (
545 | 00E356F31AD99517003FC87E /* appTests.m in Sources */,
546 | );
547 | runOnlyForDeploymentPostprocessing = 0;
548 | };
549 | 13B07F871A680F5B00A75B9A /* Sources */ = {
550 | isa = PBXSourcesBuildPhase;
551 | buildActionMask = 2147483647;
552 | files = (
553 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
554 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
555 | );
556 | runOnlyForDeploymentPostprocessing = 0;
557 | };
558 | /* End PBXSourcesBuildPhase section */
559 |
560 | /* Begin PBXTargetDependency section */
561 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
562 | isa = PBXTargetDependency;
563 | target = 13B07F861A680F5B00A75B9A /* app */;
564 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
565 | };
566 | /* End PBXTargetDependency section */
567 |
568 | /* Begin PBXVariantGroup section */
569 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
570 | isa = PBXVariantGroup;
571 | children = (
572 | 13B07FB21A68108700A75B9A /* Base */,
573 | );
574 | name = LaunchScreen.xib;
575 | path = app;
576 | sourceTree = "";
577 | };
578 | /* End PBXVariantGroup section */
579 |
580 | /* Begin XCBuildConfiguration section */
581 | 00E356F61AD99517003FC87E /* Debug */ = {
582 | isa = XCBuildConfiguration;
583 | buildSettings = {
584 | BUNDLE_LOADER = "$(TEST_HOST)";
585 | GCC_PREPROCESSOR_DEFINITIONS = (
586 | "DEBUG=1",
587 | "$(inherited)",
588 | );
589 | INFOPLIST_FILE = appTests/Info.plist;
590 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
591 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
592 | PRODUCT_NAME = "$(TARGET_NAME)";
593 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/app";
594 | LIBRARY_SEARCH_PATHS = (
595 | "$(inherited)",
596 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
597 | );
598 | };
599 | name = Debug;
600 | };
601 | 00E356F71AD99517003FC87E /* Release */ = {
602 | isa = XCBuildConfiguration;
603 | buildSettings = {
604 | BUNDLE_LOADER = "$(TEST_HOST)";
605 | COPY_PHASE_STRIP = NO;
606 | INFOPLIST_FILE = appTests/Info.plist;
607 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
608 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
609 | PRODUCT_NAME = "$(TARGET_NAME)";
610 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/app.app/app";
611 | LIBRARY_SEARCH_PATHS = (
612 | "$(inherited)",
613 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
614 | );
615 | };
616 | name = Release;
617 | };
618 | 13B07F941A680F5B00A75B9A /* Debug */ = {
619 | isa = XCBuildConfiguration;
620 | buildSettings = {
621 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
622 | DEAD_CODE_STRIPPING = NO;
623 | HEADER_SEARCH_PATHS = (
624 | "$(inherited)",
625 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
626 | "$(SRCROOT)/../node_modules/react-native/React/**",
627 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
628 | );
629 | INFOPLIST_FILE = app/Info.plist;
630 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
631 | OTHER_LDFLAGS = (
632 | "$(inherited)",
633 | "-ObjC",
634 | "-lc++",
635 | );
636 | PRODUCT_NAME = app;
637 | };
638 | name = Debug;
639 | };
640 | 13B07F951A680F5B00A75B9A /* Release */ = {
641 | isa = XCBuildConfiguration;
642 | buildSettings = {
643 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
644 | HEADER_SEARCH_PATHS = (
645 | "$(inherited)",
646 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
647 | "$(SRCROOT)/../node_modules/react-native/React/**",
648 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
649 | );
650 | INFOPLIST_FILE = app/Info.plist;
651 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
652 | OTHER_LDFLAGS = (
653 | "$(inherited)",
654 | "-ObjC",
655 | "-lc++",
656 | );
657 | PRODUCT_NAME = app;
658 | };
659 | name = Release;
660 | };
661 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
662 | isa = XCBuildConfiguration;
663 | buildSettings = {
664 | ALWAYS_SEARCH_USER_PATHS = NO;
665 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
666 | CLANG_CXX_LIBRARY = "libc++";
667 | CLANG_ENABLE_MODULES = YES;
668 | CLANG_ENABLE_OBJC_ARC = YES;
669 | CLANG_WARN_BOOL_CONVERSION = YES;
670 | CLANG_WARN_CONSTANT_CONVERSION = YES;
671 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
672 | CLANG_WARN_EMPTY_BODY = YES;
673 | CLANG_WARN_ENUM_CONVERSION = YES;
674 | CLANG_WARN_INT_CONVERSION = YES;
675 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
676 | CLANG_WARN_UNREACHABLE_CODE = YES;
677 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
678 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
679 | COPY_PHASE_STRIP = NO;
680 | ENABLE_STRICT_OBJC_MSGSEND = YES;
681 | GCC_C_LANGUAGE_STANDARD = gnu99;
682 | GCC_DYNAMIC_NO_PIC = NO;
683 | GCC_OPTIMIZATION_LEVEL = 0;
684 | GCC_PREPROCESSOR_DEFINITIONS = (
685 | "DEBUG=1",
686 | "$(inherited)",
687 | );
688 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
689 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
690 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
691 | GCC_WARN_UNDECLARED_SELECTOR = YES;
692 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
693 | GCC_WARN_UNUSED_FUNCTION = YES;
694 | GCC_WARN_UNUSED_VARIABLE = YES;
695 | HEADER_SEARCH_PATHS = (
696 | "$(inherited)",
697 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
698 | "$(SRCROOT)/../node_modules/react-native/React/**",
699 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
700 | );
701 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
702 | MTL_ENABLE_DEBUG_INFO = YES;
703 | ONLY_ACTIVE_ARCH = YES;
704 | SDKROOT = iphoneos;
705 | };
706 | name = Debug;
707 | };
708 | 83CBBA211A601CBA00E9B192 /* Release */ = {
709 | isa = XCBuildConfiguration;
710 | buildSettings = {
711 | ALWAYS_SEARCH_USER_PATHS = NO;
712 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
713 | CLANG_CXX_LIBRARY = "libc++";
714 | CLANG_ENABLE_MODULES = YES;
715 | CLANG_ENABLE_OBJC_ARC = YES;
716 | CLANG_WARN_BOOL_CONVERSION = YES;
717 | CLANG_WARN_CONSTANT_CONVERSION = YES;
718 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
719 | CLANG_WARN_EMPTY_BODY = YES;
720 | CLANG_WARN_ENUM_CONVERSION = YES;
721 | CLANG_WARN_INT_CONVERSION = YES;
722 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
723 | CLANG_WARN_UNREACHABLE_CODE = YES;
724 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
725 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
726 | COPY_PHASE_STRIP = YES;
727 | ENABLE_NS_ASSERTIONS = NO;
728 | ENABLE_STRICT_OBJC_MSGSEND = YES;
729 | GCC_C_LANGUAGE_STANDARD = gnu99;
730 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
731 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
732 | GCC_WARN_UNDECLARED_SELECTOR = YES;
733 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
734 | GCC_WARN_UNUSED_FUNCTION = YES;
735 | GCC_WARN_UNUSED_VARIABLE = YES;
736 | HEADER_SEARCH_PATHS = (
737 | "$(inherited)",
738 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
739 | "$(SRCROOT)/../node_modules/react-native/React/**",
740 | "$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
741 | );
742 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
743 | MTL_ENABLE_DEBUG_INFO = NO;
744 | SDKROOT = iphoneos;
745 | VALIDATE_PRODUCT = YES;
746 | };
747 | name = Release;
748 | };
749 | /* End XCBuildConfiguration section */
750 |
751 | /* Begin XCConfigurationList section */
752 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "appTests" */ = {
753 | isa = XCConfigurationList;
754 | buildConfigurations = (
755 | 00E356F61AD99517003FC87E /* Debug */,
756 | 00E356F71AD99517003FC87E /* Release */,
757 | );
758 | defaultConfigurationIsVisible = 0;
759 | defaultConfigurationName = Release;
760 | };
761 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "app" */ = {
762 | isa = XCConfigurationList;
763 | buildConfigurations = (
764 | 13B07F941A680F5B00A75B9A /* Debug */,
765 | 13B07F951A680F5B00A75B9A /* Release */,
766 | );
767 | defaultConfigurationIsVisible = 0;
768 | defaultConfigurationName = Release;
769 | };
770 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "app" */ = {
771 | isa = XCConfigurationList;
772 | buildConfigurations = (
773 | 83CBBA201A601CBA00E9B192 /* Debug */,
774 | 83CBBA211A601CBA00E9B192 /* Release */,
775 | );
776 | defaultConfigurationIsVisible = 0;
777 | defaultConfigurationName = Release;
778 | };
779 | /* End XCConfigurationList section */
780 | };
781 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
782 | }
783 |
--------------------------------------------------------------------------------