Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b08b1b1126
@ -24,7 +24,7 @@ $ rnpm link react-native-update
|
||||
如果你的react-native版本小于或等于0.26,第二句请修改为
|
||||
|
||||
```bash
|
||||
$ npm install --save react-native-update@1.0.x
|
||||
$ npm install --save --save-exact react-native-update@1.0.x
|
||||
```
|
||||
|
||||
* 注意 *
|
||||
@ -71,7 +71,25 @@ npm config set disturl https://npm.taobao.org/dist --global
|
||||
|
||||
## 配置Bundle URL(Android)
|
||||
|
||||
在你的ReactActivity中增加如下代码:
|
||||
`0.29及以后版本`:在你的MainApplication中增加如下代码:
|
||||
|
||||
```java
|
||||
// ... 其它代码
|
||||
|
||||
import cn.reactnative.modules.update.UpdateContext;
|
||||
public class MainApplication extends Application implements ReactApplication {
|
||||
|
||||
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
||||
@Override
|
||||
protected String getJSBundleFile() {
|
||||
return UpdateContext.getBundleUrl(MainApplication.this);
|
||||
}
|
||||
// ... 其它代码
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`0.28及以前版本`:在你的MainActivity中增加如下代码:
|
||||
|
||||
```java
|
||||
// ... 其它代码
|
||||
|
@ -5,7 +5,7 @@
|
||||
检查更新时必须提供你的`appKey`,这个值保存在`update.json`中,并且根据平台不同而不同。你可以用如下的代码获取:
|
||||
|
||||
```javascript
|
||||
import React, {
|
||||
import {
|
||||
Platform,
|
||||
} from 'react-native';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user