1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 10:31:39 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
Files
react-native-update/README.md
2019-10-25 12:09:21 +08:00

75 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# react-native-update [![npm version](https://badge.fury.io/js/react-native-update.svg)](http://badge.fury.io/js/react-native-update)
本组件是面向 React Native 提供热更新功能的组件,建议结合[Update 服务](https://update.reactnative.cn/)使用。
注意在iOS上使用热更新有被拒的可能。可以按以下步骤屏蔽iOS端
1. 如果RN版本>=0.60在项目根目录下编辑或创建react-native.config.js添加如下内容
```js
// react-native.config.js
module.exports = {
dependencies: {
'react-native-update': {
platforms: {
ios: null, // 阻止ios模块自动链接
},
},
},
};
```
2. 如果在原生代码端尚未配置则跳过下面文档中的ios端的配置。如果已经配置则按文档的步骤反向操作添加的ios代码删去
3. 如果是0.60以上版本或使用了cocoapods在ios目录中再次运行pod install确保Podfile和Podfile.lock中都没有'react-native-update'。如果RN版本<0.60则运行`react-native unlink react-native-update`
4. 在js代码里调用checkUpdate()方法前判断Platform.OS如果是ios平台则直接return跳过
```
### 最近更新
请查阅[最近更新文档](CHANGELOG.md)。
### 优势
1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成 CI。
2. 基于 bsdiff 算法创建的**超小更新包**,通常版本迭代后在 1-10KB 之间,避免数百 KB 的流量消耗。
3. 支持崩溃回滚,安全可靠。
4. meta 信息及开放 API提供更高扩展性。
5. 跨越多个版本进行更新时,只需要下载**一个更新包**,不需要逐版本依次更新。
### 安装与快速入门
请查阅
- [文档-快速入门-准备工作](docs/guide.md)。
- [文档-快速入门-添加热更新功能](docs/guide2.md)。
- [文档-快速入门-发布版本](docs/guide3.md)。
- [文档-常见问题与高级指南](docs/faq_advance.md)。
### 命令行工具
请查阅[文档-命令行工具](docs/cli.md)。
### API 接口
请查阅[文档-API 接口](docs/api.md)。
### 本地开发
```
$ git clone git@github.com:reactnativecn/react-native-pushy.git
$ cd react-native-pushy/Example/testHotUpdate
$ yarn
$ yarn start
```
本地库文件使用yarn link链接因此可直接在源文件中修改在testHotUpdate项目中调试
### 关于我们
本组件由[React Native 中文网](https://reactnative.cn/)独家发布如有定制需求可以[联系我们](https://reactnative.cn/about.html#content)
关于此插件发现任何问题可以前往[Issues](https://github.com/reactnativecn/react-native-pushy/issues)或者[中文社区](http://bbs.reactnative.cn/category/7)发帖提问