1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
tdzl2003 2017-05-04 20:26:08 +08:00
commit 48b70f3bf4
5 changed files with 26 additions and 20 deletions

View File

@ -11,8 +11,7 @@ React Native版本 | react-native-update版本
<= 0.26 | 1.0.x
0.27 - 0.28 | 2.x
0.29 - 0.33 | 3.x
0.34 - 0.39 | 4.x
0.40         |   暂不支持 
0.34 - 当前  |   4.x
### 优势

View File

@ -38,8 +38,7 @@ React Native版本 | react-native-update版本
<= 0.26 | 1.0.x
0.27 - 0.28 | 2.x
0.29 - 0.33 | 3.x
0.34 - 0.39  |   4.x
0.40         |   暂不支持 
0.34 - 当前  |   4.x
安装命令示例:
```
@ -55,7 +54,8 @@ npm install --save react-native-update@3.x
1. 在XCode中的Project Navigator里,右键点击`Libraries` ➜ `Add Files to [你的工程名]`
2. 进入`node_modules` ➜ `react-native-update``ios 并选中 `RCTHotUpdate.xcodeproj`
3. 在XCode中的project navigator里,选中你的工程,在 `Build Phases``Link Binary With Libraries` 中添加 `libRCTHotUpdate.a`
4. Run your project (`Cmd+R`)
4. 继续在`Build Settings`里搜索`Header Search Path`,添加$(SRCROOT)/../node_modules/react-native-update/ios
5. Run your project (`Cmd+R`)
#### Android

View File

@ -6,7 +6,11 @@
// Copyright © 2016 erica. All rights reserved.
//
#if __has_include(<React/RCTBridge.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif
@interface RCTHotUpdate : NSObject<RCTBridgeModule>

View File

@ -6,22 +6,18 @@
// Copyright © 2016 erica. All rights reserved.
//
#if __has_include(<React/RCTBridge.h>)
#import <React/RCTHotUpdate.h>
#import <React/RCTHotUpdateDownloader.h>
#import "React/RCTEventDispatcher.h"
#import <React/RCTConvert.h>
#import <React/RCTHotUpdateManager.h>
#import <React/RCTLog.h>
#else
#import "RCTHotUpdate.h"
#import "RCTHotUpdateDownloader.h"
#import "RCTHotUpdateManager.h"
#if __has_include(<React/RCTBridge.h>)
#import "React/RCTEventDispatcher.h"
#import <React/RCTConvert.h>
#import <React/RCTLog.h>
#else
#import "RCTEventDispatcher.h"
#import "RCTConvert.h"
#import "RCTHotUpdateManager.h"
#import "RCTLog.h"
#endif
//

View File

@ -382,10 +382,17 @@ export const commands = {
let defaultConfig;
if (major >= 0 && minor >= 33) {
defaultConfig= Config.get(
path.resolve('node_modules/react-native/local-cli'),
require(path.resolve('node_modules/react-native/local-cli/default.config')),
path.resolve('node_modules/react-native/packager/rn-cli.config.js'));
if (minor >= 42) {
defaultConfig= Config.get(
path.resolve('node_modules/react-native/local-cli'),
require(path.resolve('node_modules/react-native/local-cli/core/default.config')),
path.resolve('node_modules/react-native/packager/rn-cli.config.js'));
} else {
defaultConfig= Config.get(
path.resolve('node_modules/react-native/local-cli'),
require(path.resolve('node_modules/react-native/local-cli/default.config')),
path.resolve('node_modules/react-native/packager/rn-cli.config.js'));
}
} else {
defaultConfig= Config.get(path.resolve('node_modules/react-native/local-cli'), require(path.resolve('node_modules/react-native/local-cli/default.config')));
}