Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnylqm committed Dec 3, 2023
1 parent 92a30e1 commit a78d737
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion site/pages/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const hash = await downloadUpdate(

下载更新的 apk 包并直接安装。`url`必须为可直接下载到 apk 文件的地址,`onDownloadProgress`为可选的下载进度回调函数,可根据回调参数自行设计进度的展示。自`v5.9.0`版本起可用。

注意从`v9.1.0`版本起,要使用这个功能需要在`AndroidManifest.xml`中手动添加安装权限,如果需要考虑 Android 7.0 以下的客户,则还需要添加外部存储权限。
注意要使用这个功能还需要在`AndroidManifest.xml`中手动添加安装权限,如果需要考虑 Android 7.0 以下的客户,则还需要添加外部存储权限。

```xml
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
Expand Down
3 changes: 3 additions & 0 deletions site/pages/docs/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,15 @@ export default class MyProject extends Component {
{
text: "确定",
onPress: () => {
// downloadUrl 需要在后台设置中自行配置
if (info.downloadUrl) {
// apk可直接下载安装
if (
Platform.OS === "android" &&
info.downloadUrl.endsWith(".apk")
) {
// 此方法还需要额外的配置,请参考
// https://pushy.reactnative.cn/docs/api#async-function-downloadandinstallapk-url-ondownloadprogress-
downloadAndInstallApk({
url: info.downloadUrl,
onDownloadProgress: ({ received, total }) => {
Expand Down

0 comments on commit a78d737

Please sign in to comment.