Skip to main content

App Update — Events

Seven events fire across the App Update lifecycle, all on Android (Play Core's update flow). On iOS and web, App Update is fundamentally synchronous (a single getAppUpdateInfo() call followed by openAppStore()), so these events do not fire on those platforms.

Subscribe with addListener(); the returned handle has a remove() method.

import { NativeUpdate } from 'native-update';
import type {
AppUpdateStateChangedEvent,
AppUpdateProgressEvent,
AppUpdateAvailableEvent,
AppUpdateReadyEvent,
AppUpdateFailedEvent,
AppUpdateNotificationClickedEvent,
AppUpdateInstallClickedEvent,
PluginListenerHandle,
} from 'native-update';

appUpdateStateChanged

Fires whenever the install status of an in-progress flexible update changes.

interface AppUpdateStateChangedEvent {
status: InstallStatus;
installErrorCode?: number;
}
FieldTypeDescription
statusInstallStatusNew status of the install.
installErrorCodenumberPlay Core's raw error code when status === FAILED. See the Google reference.
const handle = await NativeUpdate.addListener(
'appUpdateStateChanged',
({ status, installErrorCode }: AppUpdateStateChangedEvent) => {
if (status === 'FAILED') {
reportToSentry(`Update install failed (code ${installErrorCode})`);
}
},
);

InstallStatus

MemberWire valueMeaning
UNKNOWN'UNKNOWN'Initial state; no update flow active.
PENDING'PENDING'User accepted the prompt; download not started.
DOWNLOADING'DOWNLOADING'Bytes are being fetched from Play.
DOWNLOADED'DOWNLOADED'Download complete; install has not yet started.
INSTALLING'INSTALLING'Play is applying the APK.
INSTALLED'INSTALLED'Done; the app will relaunch.
FAILED'FAILED'Install or download failed.
CANCELED'CANCELED'User cancelled mid-flow.

appUpdateProgress

Fires repeatedly during a flexible-update download.

interface AppUpdateProgressEvent {
percent: number;
bytesDownloaded: number;
totalBytes: number;
}
FieldTypeDescription
percentnumber0–100.
bytesDownloadednumberBytes received so far.
totalBytesnumberTotal APK size.

Wire directly into a progress UI without throttling — Play emits ~10–20 events per download.


appUpdateAvailable

Fires when getAppUpdateInfo() discovers an update. Useful when you want a single subscriber to react to "an update is available now" instead of polling.

interface AppUpdateAvailableEvent {
currentVersion: string;
availableVersion: string;
updatePriority: number;
updateSize?: number;
releaseNotes?: string[];
storeUrl?: string;
}
FieldTypeDescription
currentVersionstringInstalled version.
availableVersionstringNew version available.
updatePrioritynumberPlay priority 0–5.
updateSizenumberBytes (from Play's metadata, when present).
releaseNotesstring[]Localised release notes from the Play listing.
storeUrlstringDirect deep link to the store page.

appUpdateReady

Fires when a flexible update has finished downloading and is ready for completeFlexibleUpdate().

interface AppUpdateReadyEvent {
message: string;
}
FieldTypeDescription
messagestringHuman-readable message you can surface in a snackbar (localised by the SDK).
await NativeUpdate.addListener('appUpdateReady', ({ message }: AppUpdateReadyEvent) => {
showSnackbar(message, {
action: { label: 'Restart', onClick: () => NativeUpdate.completeFlexibleUpdate() },
});
});

appUpdateFailed

Fires when an immediate or flexible update fails for any reason.

interface AppUpdateFailedEvent {
error: string;
code: string;
}
FieldTypeDescription
errorstringHuman-readable failure summary.
codestringStable error code from UpdateErrorCode enum.

appUpdateNotificationClicked

Fires when the user taps a system notification that the SDK posted (only relevant if you enable Background Updates and opt in to update notifications). Empty payload — the event itself is the signal.


appUpdateInstallClicked

Fires when the user taps the "Install" or "Restart" action on a notification that announced an appUpdateReady state. Empty payload. Typically the listener calls NativeUpdate.completeFlexibleUpdate() directly.


Cleanup

await handle.remove();
// or, to remove every listener across the plugin:
await NativeUpdate.removeAllListeners();

Event reference verified against src/definitions.ts in the plugin repo as of 2026-05-10. Documented by Ahsan Mahmood.