Basic OTA update check
Confirm the boot, then sync and reload when an update was installed.
await NativeUpdate.notifyAppReady();
const result = await NativeUpdate.sync();
if (result.status === 'UPDATE_INSTALLED') {
await NativeUpdate.reload();
}Code for the setups people ask about most.
Confirm the boot, then sync and reload when an update was installed.
await NativeUpdate.notifyAppReady();
const result = await NativeUpdate.sync();
if (result.status === 'UPDATE_INSTALLED') {
await NativeUpdate.reload();
}Ask the user before you interrupt them, unless the release is mandatory.
const result = await NativeUpdate.sync();
if (result.status === 'UPDATE_INSTALLED') {
const go = result.mandatory || (await askTheUser(result.version));
if (go) await NativeUpdate.reload();
}When a release needs native code, offer the store update.
const info = await NativeUpdate.getAppUpdateInfo();
if (info.updateAvailable) {
await NativeUpdate.openAppStore();
}Ask for a rating with the store’s own prompt.
await NativeUpdate.requestReview();Sign, upload and start at 5% in one job.
npx native-update deploy ./dist --app com.example.app --rollout 5 --wait