Skip to content
On this page

applyUpdate()

应用所下载的更新包。

参数

参数名必填类型默认值备注
immediatebooleanfalse应用更新后是否重载 App

返回值

typescript
Promise<boolean>;

代码示例

typescript
import { registerUpdateManager } from "@herina-rn/client";

const manager = registerUpdateManager();

const updateBundle = async () => {
  if (await manager.checkForUpdate()) {
    await manager.requestUpdate();

    await manager.applyUpdate(true);
  } else {
    Alert.alert("No need to update.");
  }
};

await updateBundle();

Released under the MIT License.