@capacitor/live-updates
Official Live Updates plugin for Capacitor
Install
npm install @capacitor/live-updates
npx cap sync
API
sync(...)
sync(progress: ((percentage: number) => void) | undefined = undefined) => Promise<SyncResult>
Sync the app with Live Updates. Optionally takes a progress callback.
Returns: Promise<SyncResult>
setConfig(...)
setConfig(config: LiveUpdateConfig) => Promise<void>
| Param | Type |
|---|---|
config | LiveUpdateConfig |
getConfig()
getConfig() => Promise<LiveUpdateConfig>
Returns: Promise<LiveUpdateConfig>
resetConfig()
resetConfig() => Promise<void>
reload()
reload() => Promise<void>
Interfaces
SyncResult
| Prop | Type |
|---|---|
liveUpdate | LiveUpdate |
snapshot | Snapshot | null |
source | 'download' | 'cache' |
activeApplicationPathChanged | boolean |
LiveUpdate
| Prop | Type |
|---|---|
appId | string |
channel | string |
Snapshot
| Prop | Type |
|---|---|
id | string |
buildId | string |
LiveUpdateError
| Prop | Type |
|---|---|
appId | string |
failStep | 'CHECK' | 'DOWNLOAD' | 'COPY' | 'UNPACK' | 'VERIFY' | 'UPDATE' | 'CANCEL' |
message | string |
LiveUpdateConfig
| Prop | Type |
|---|---|
appId | string |
channel | string |
autoUpdateMethod | AutoUpdateMethod |
maxVersions | number |
key | string |
Type Aliases
LiveUpdateResult
AutoUpdateMethod
'none' | 'background'
LiveUpdateConfig
Partial<LiveUpdate> & { autoUpdateMethod?: 'none' | 'background'; strategy?: 'zip' | 'differential'; enabled?: boolean; maxVersions?: number; }
Partial
Make all properties in T optional
{
[P in keyof T]?: T[P];
}