Skip to content

Commit

Permalink
chore: Update PushyOptions interface to require v10.4.2 or higher for…
Browse files Browse the repository at this point in the history
… debug and autoMarkSuccess options
  • Loading branch information
sunnylqm committed Jun 11, 2024
1 parent ca1aa7d commit 35bc4c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions site/pages/docs/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ interface PushyOptions {

// 自定义日志输出,也可用于上报统计数据
logger?: ({ type, data }: { type: EventType; data: EventData }) => void;
// 是否使用系统默认的alert页面提示热更, 默认为true
useAlert?: boolean;
// 触发自动检查更新的策略
strategy?:
checkStrategy?:
| "onAppStart" // 仅在app启动时
| "onAppResume" // 仅在app从后台切换到前台时
| "both"; // 默认值,同时包含前两个场景
| null; // 不自动检查更新,必须手动调用checkUpdate方法,此选项需v10.4.2或更高版本
// 自动下载和应用更新的策略
updateStrategy?:
| "alwaysAlert" // 默认值,使用系统默认的alert页面提示热更,v10.6.0版本前为 useAlert 选项
| "silentAndNow" // 自动静默下载并立刻应用热更
| "silentAndLater"; // 自动静默下载,但仅在用户退出app后重启时应用更新
| null; // 不自动下载和应用更新,如需自定义热更界面请选择此项
// 是否在热更重启后自动标记为成功,默认为true
autoMarkSuccess?: boolean;
// 是否在若干ms后自动清除最后的报错,默认为不清除
Expand Down
4 changes: 2 additions & 2 deletions site/pages/docs/integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export default function Root() {

### 自定义更新界面

默认配置下,pushy 会以系统 alert 的形式来弹出更新提示,如需自定义更新界面,首先请关闭默认的 alert 弹窗,并打开 debug 选项以便调试:
默认配置下,pushy 会以系统 alert 的形式来弹出更新提示,如需自定义更新界面,首先请关闭默认的 updateStrategy 更新策略,并打开 debug 选项以便调试:

```diff
const pushyClient = new Pushy({
appKey,
+ useAlert: false,
+ updateStrategy: null,
+ debug: true,
});
```
Expand Down

0 comments on commit 35bc4c6

Please sign in to comment.