Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt

Use this file to discover all available pages before exploring further.

Get an UpdateManager instance to manage Mini Program updates.

Return Value

Returns an UpdateManager object.

UpdateManager Methods

MethodDescription
onCheckForUpdate(callback)Called when update check completes
onUpdateReady(callback)Called when new version is downloaded
onUpdateFailed(callback)Called when update download fails
applyUpdate()Force apply and restart with new version

Code Example

const updateManager = my.getUpdateManager();

updateManager.onCheckForUpdate((res) => {
  console.log('Has update:', res.hasUpdate);
});

updateManager.onUpdateReady(() => {
  my.confirm({
    title: 'Update Available',
    content: 'Restart to apply the new version?',
    success: (res) => {
      if (res.confirm) {
        updateManager.applyUpdate();
      }
    }
  });
});

updateManager.onUpdateFailed(() => {
  console.log('Update download failed');
});