diff --git a/README.md b/README.md index 91d5b13..4816a05 100644 --- a/README.md +++ b/README.md @@ -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 ### 优势 diff --git a/docs/guide.md b/docs/guide.md index 65cc331..7621233 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -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 diff --git a/ios/RCTHotUpdate/RCTHotUpdate.h b/ios/RCTHotUpdate/RCTHotUpdate.h index 1276bd3..da47c6e 100644 --- a/ios/RCTHotUpdate/RCTHotUpdate.h +++ b/ios/RCTHotUpdate/RCTHotUpdate.h @@ -6,7 +6,11 @@ // Copyright © 2016 erica. All rights reserved. // +#if __has_include() +#import +#else #import "RCTBridgeModule.h" +#endif @interface RCTHotUpdate : NSObject diff --git a/ios/RCTHotUpdate/RCTHotUpdate.m b/ios/RCTHotUpdate/RCTHotUpdate.m index 4960e85..9f75e29 100644 --- a/ios/RCTHotUpdate/RCTHotUpdate.m +++ b/ios/RCTHotUpdate/RCTHotUpdate.m @@ -6,22 +6,18 @@ // Copyright © 2016 erica. All rights reserved. // -#if __has_include() -#import -#import -#import "React/RCTEventDispatcher.h" -#import -#import -#import -#else - #import "RCTHotUpdate.h" #import "RCTHotUpdateDownloader.h" +#import "RCTHotUpdateManager.h" + +#if __has_include() +#import "React/RCTEventDispatcher.h" +#import +#import +#else #import "RCTEventDispatcher.h" #import "RCTConvert.h" -#import "RCTHotUpdateManager.h" #import "RCTLog.h" - #endif // diff --git a/local-cli/src/bundle.js b/local-cli/src/bundle.js index 6768c4d..ddac802 100644 --- a/local-cli/src/bundle.js +++ b/local-cli/src/bundle.js @@ -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'))); }