@capgo/capacitor-updater
Live update for capacitor apps.
Overview
Section titled “Overview”Live update for capacitor apps.
Core Capabilities
Section titled “Core Capabilities”notifyAppReady- Notify the native layer that JavaScript initialized successfully.setUpdateUrl- Set the update URL for the app dynamically at runtime.setStatsUrl- Set the statistics URL for the app dynamically at runtime.setChannelUrl- Set the channel URL for the app dynamically at runtime.
Public API
Section titled “Public API”| Method | Description |
|---|---|
notifyAppReady | Notify the native layer that JavaScript initialized successfully. |
setUpdateUrl | Set the update URL for the app dynamically at runtime. |
setStatsUrl | Set the statistics URL for the app dynamically at runtime. |
setChannelUrl | Set the channel URL for the app dynamically at runtime. |
download | Download a new bundle from the provided URL for later installation. |
next | Set the next bundle to be activated when the app backgrounds or restarts. |
set | Set the current bundle and immediately reloads the app. |
delete | Delete a bundle from local storage to free up disk space. |
setBundleError | Manually mark a bundle as failed/errored in manual update mode. |
list | Get all locally downloaded bundles stored in your app. |
reset | Reset the app to a known good bundle. |
current | Get information about the currently active bundle. |
reload | Manually reload the app to apply a pending update. |
setMultiDelay | Configure conditions that must be met before a pending update is applied. |
cancelDelay | Cancel all delay conditions and apply the pending update immediately. |
getLatest | Check the update server for the latest available bundle version. |
setChannel | Assign this device to a specific update channel at runtime. |
unsetChannel | Remove the device’s channel assignment and return to the default channel. |
getChannel | Get the current channel assigned to this device. |
listChannels | Get a list of all channels available for this device to self-assign to. |
setCustomId | Set a custom identifier for this device. |
getBuiltinVersion | Get the builtin bundle version (the original version shipped with your native app). |
getDeviceId | Get the unique, privacy-friendly identifier for this device. |
getPluginVersion | Get the version of the Capacitor Updater plugin installed in your app. |
isAutoUpdateEnabled | Check if automatic updates are currently enabled. |
removeAllListeners | Remove all event listeners registered for this plugin. |
addListener | Listen for bundle download event in the App. Fires once a download has started, during downloading and when finished. This will return you all download percent during the download. |
addListener | Listen for no need to update event, useful when you want force check every time the app is launched. |
addListener | Listen for available update event, useful when you want to force check every time the app is launched. |
addListener | Listen for downloadComplete events. |
addListener | Listen for breaking update events when the backend flags an update as incompatible with the current app. Emits the same payload as the legacy majorAvailable listener. |
addListener | Listen for Major update event in the App, let you know when major update is blocked by setting disableAutoUpdateBreaking. |
addListener | Listen for update fail event in the App, let you know when update has fail to install at next app start. |
addListener | Listen for set event in the App, let you know when a bundle has been applied successfully. This event is retained natively until JavaScript consumes it, so if the app reloads before your listener is attached, the last pending set event is delivered once the listener subscribes. |
addListener | Listen for set next event in the App, let you know when a bundle is queued as the next bundle to install. |
addListener | Listen for download fail event in the App, let you know when a bundle download has failed. |
addListener | Listen for reload event in the App, let you know when reload has happened. |
addListener | Listen for app ready event in the App, let you know when app is ready to use. This event is retained natively until JavaScript consumes it, so it can still be delivered after a reload even if the listener is attached later in app startup. |
addListener | Listen for channel private event, fired when attempting to set a channel that doesn’t allow device self-assignment. |
addListener | Listen for flexible update state changes on Android. |
isAutoUpdateAvailable | Check if the auto-update feature is available (not disabled by custom server configuration). |
getNextBundle | Get information about the bundle queued to be activated on next reload. |
getFailedUpdate | Retrieve information about the most recent bundle that failed to load. |
setShakeMenu | Enable or disable the shake gesture menu for debugging and testing. |
isShakeMenuEnabled | Check if the shake gesture debug menu is currently enabled. |
setShakeChannelSelector | Enable or disable the shake channel selector at runtime. |
isShakeChannelSelectorEnabled | Check if the shake channel selector is currently enabled. |
getAppId | Get the currently configured App ID used for update server communication. |
setAppId | Dynamically change the App ID used for update server communication. |
getAppUpdateInfo | Get information about the app’s availability in the App Store or Play Store. |
openAppStore | Open the app’s page in the App Store or Play Store. |
performImmediateUpdate | Perform an immediate in-app update on Android. |
startFlexibleUpdate | Start a flexible in-app update on Android. |
completeFlexibleUpdate | Complete a flexible in-app update on Android. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-updater.