跳过内容

功能和设置

GitHub

查看Github README 了解更多信息。

CapacitorUpdater 可以通过以下选项进行配置:

属性类型描述默认值
appReadyTimeoutnumber配置 native 插件在考虑更新失败之前等待的毫秒数。可用于 Android、iOS 和 Electron。10000 // (10 seconds)
responseTimeoutnumberConfigure the number of milliseconds the native plugin should wait before considering API timeout. Available on Android, iOS, and Electron.20000 // (20 seconds)
autoDeleteFailedboolean配置是否使用自动删除失败的包。可用于 Android、iOS 和 Electron。true
autoDeletePreviousboolean配置是否在更新成功后自动删除之前的包。可用于 Android、iOS 和 Electron。true
autoUpdateboolean | ‘off’ | ‘atBackground’ | ‘atInstall’ | ‘onLaunch’ | ‘always’ | ‘onlyDownload’通过更新服务器配置插件如何使用自动更新。 true 与“atBackground”相同,false 与“off”相同。 - off:禁用自动更新 - atBackground:在应用程序切换到后台时自动检查和下载,然后在应用程序切换到后台时应用 - atInstall:仅在新安装或原生应用程序更新后立即应用,否则使用 atBackground - onLaunch:在启动时立即应用,否则在启动检查后使用 atBackground - always:在自动更新运行时立即应用 - onlyDownload:自动检查和下载,发出updateAvailable,永远不会设置下一个捆绑包。 立即应用模式(“atInstall”,“onLaunch”,“always”)应与 —delta 一起上传,以避免更新慢下用户体验。 在 Android 和 iOS 上,需要设置 autoSplashscreen:true 和 @capacitor/splash-screen,launchAutoHide:false。 可用于 Android、iOS 和 Electron。“atBackground” // true is still accepted
resetWhenUpdateboolean自动删除设备上安装的新版本原生应用程序捆绑包时下载的以前捆绑包。 可用于 Android、iOS 和 Electron。true
updateUrlstring配置更新检查的 URL / 端点。 可用于 Android、iOS 和 Electron。https://plugin.capgo.app/updates
channelUrlstring配置用于频道操作的 URL / 端点。 可用于 Android、iOS 和 Electron。https://plugin.capgo.app/channel_self
statsUrlstring配置更新统计信息的 URL / 端点。 可用于 Android、iOS 和 Electron。 将其设置为 "" 以禁用统计信息报告。https://plugin.capgo.app/stats
publicKeystring配置公钥用于端到端实时更新加密,版本 2。可用于 Android、iOS 和 Electron。undefined6.2.0
versionstring配置应用程序的当前版本。首次更新请求时会使用此版本。如果未设置,插件将从原生 code 中获取版本。可用于 Android、iOS 和 Electron。undefined4.17.48
directUpdateboolean | ‘always’ | ‘atInstall’ | ‘onLaunch’已弃用。使用“atInstall”,“onLaunch”或“always”模式代替:autoUpdate。该选项仍支持现有应用程序。立即应用应上传 —delta 以避免更新时用户体验受影响。Android 和 iOS 上这些模式需要 autoSplashscreen:true 和 @capacitor/splash-screen 的 launchAutoHide:false。- false:永不进行直接更新- atInstall:与 autoUpdate:“atInstall”相同- onLaunch:与 autoUpdate:“onLaunch”相同- always:与 autoUpdate:“always”相同- true:与“always”相同,用于向后兼容性。可用于 Android、iOS 和 Electron。false5.1.0
autoSplashscreenboolean在使用“atInstall”,“onLaunch”或“always”模式(包括已弃用的直接更新值)时必需,包括 @capacitor/splash-screen 必须已安装并配置 launchAutoHide:false。启用后,插件在更新应用程序或无需更新时隐藏启动屏幕。从而避免手动监听 appReady 事件并调用 SplashScreen.hide()。可用于 Android 和 iOS。false7.6.0
periodCheckDelaynumber配置延迟更新检查的时间周期。单位为秒。可用于 Android、iOS 和 Electron。不能小于 600 秒(10 分钟)。600 // (10 minutes)
localS3boolean配置CLI以使用本地服务器进行测试或自托管更新服务器。undefined4.17.48
localHoststring配置CLI以使用本地服务器进行测试或自托管更新服务器。undefined4.17.48
localWebHoststring配置CLI以使用本地服务器进行测试或自托管更新服务器。undefined4.17.48
localSupastring配置CLI以使用本地服务器进行测试或自托管更新服务器。undefined4.17.48
localSupaAnonstring配置CLI以使用本地服务器进行测试。undefined4.17.48
localApistring配置CLI以使用本地api进行测试。undefined6.3.3
localApiFilesstring配置CLI以使用本地文件api进行测试。undefined6.3.3
allowModifyUrlboolean允许插件动态从 JavaScript 端修改 updateUrl、statsUrl 和 channelUrl。false5.4.0
defaultChannelstring设置应用程序的默认频道。区分大小写。这将覆盖云端设置的默认频道,但仍会尊重云端设置的覆盖。undefined5.5.0
appIdstring配置应用程序的 ID。undefined6.0.0
keepUrlPathAfterReloadboolean配置插件以在重新加载后保留 URL 路径。警告:当触发重新加载时,‘window.history’ 将被清除。false6.8.0
disableJSLoggingboolean关闭插件的 JavaScript 日志。如果为 true,插件将不会在 JavaScript 控制台中记录日志。只有本机日志会被执行。false7.3.0
shakeMenuboolean启用抖动手势以在调试/测试目的下显示更新菜单。false7.5.0

示例

示例

capacitor.config.json:

{
"plugins": {
"CapacitorUpdater": {
"appReadyTimeout": 1000 // (1 second),
"responseTimeout": 10 // (10 second),
"autoDeleteFailed": false,
"autoDeletePrevious": false,
"autoUpdate": "onlyDownload",
"resetWhenUpdate": false,
"updateUrl": https://example.com/api/auto_update,
"channelUrl": https://example.com/api/channel,
"statsUrl": https://example.com/api/stats,
"publicKey": undefined,
"version": undefined,
"directUpdate": undefined,
"autoSplashscreen": undefined,
"periodCheckDelay": undefined,
"localS3": undefined,
"localHost": undefined,
"localWebHost": undefined,
"localSupa": undefined,
"localSupaAnon": undefined,
"localApi": undefined,
"localApiFiles": undefined,
"allowModifyUrl": undefined,
"defaultChannel": undefined,
"appId": undefined,
"keepUrlPathAfterReload": undefined,
"disableJSLogging": undefined,
"shakeMenu": undefined
}
}
}

capacitor.config.ts:

import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
plugins: {
CapacitorUpdater: {
appReadyTimeout: 1000 // (1 second),
responseTimeout: 10 // (10 second),
autoDeleteFailed: false,
autoDeletePrevious: false,
autoUpdate: 'onlyDownload',
resetWhenUpdate: false,
updateUrl: https://example.com/api/auto_update,
channelUrl: https://example.com/api/channel,
statsUrl: https://example.com/api/stats,
publicKey: undefined,
version: undefined,
directUpdate: undefined,
autoSplashscreen: undefined,
periodCheckDelay: undefined,
localS3: undefined,
localHost: undefined,
localWebHost: undefined,
localSupa: undefined,
localSupaAnon: undefined,
localApi: undefined,
localApiFiles: undefined,
allowModifyUrl: undefined,
defaultChannel: undefined,
appId: undefined,
keepUrlPathAfterReload: undefined,
disableJSLogging: undefined,
shakeMenu: undefined,
},
},
};
export default config;

方法

方法

notifyAppReady()

notifyAppReady()
notifyAppReady() => Promise<AppReadyResult>

通知Capacitor更新器当前包正在工作(如果不在每次应用启动时调用此方法,则会发生回滚) 默认情况下,此方法应在应用启动后10秒内被调用,否则会发生回滚。 可以通过{@link appReadyTimeout}更改此行为

返回: Promise<AppReadyResult>


setUpdateUrl(…)

setUpdateUrl(…)
setUpdateUrl(options: UpdateUrl) => Promise<void>

参数

类型描述set the updateUrl for the app, this will be used to check for updates.
optionsUpdateUrl包含用于检查更新的 URL。

自从: 5.4.0


setStatsUrl(options: StatsUrl) => Promise<void>

设置应用的statsUrl,用于发送统计数据。传入空字符串将禁用统计数据收集。

参数类型描述
optionsStatsUrl包含用于发送统计数据的 URL。

自从: 5.4.0


setChannelUrl(options: ChannelUrl) => Promise<void>

为应用设置channelUrl,这将用于设置频道。

参数类型描述
optionsChannelUrl包含用于设置频道的URL。

自: 5.4.0


download(options: DownloadOptions) => Promise<BundleInfo>

从提供的URL下载一个新的包,应该是一个zip文件,或者一个唯一id的包里包含所有文件

参数类型描述
optionsDownloadOptions下载新包 zip 时的 {@link} 下载选项}。

返回: Promise<BundleInfo>


next(options: BundleId) => Promise<BundleInfo>

设置下次重载应用时使用的包。

参数类型描述
optionsBundleId包含下一次应用启动时设置的下一个捆绑包的ID。 {@link} 捆绑包信息.id}

返回: Promise<BundleInfo>


set(options: BundleId) => Promise<void>

设置当前捆绑包并立即重新加载应用。

参数类型描述
optionsBundleIdA {@link} BundleId} 对象,包含要设置为当前的新包 ID。

delete(options: BundleId) => Promise<void>

从原生应用存储中删除指定的包。使用 {@link list} 来获取存储的 Bundle IDs。

ParamTypeDescription
optionsBundleIdA {@link} BundleId包含要删除的包 ID 的对象(注意,这是包 ID,而不是版本名称)

list(options?: ListOptions | undefined) => Promise<BundleListResult>

获取本地下载的所有包

参数类型描述
optionsListOptions用于列出包的 {@link} ListOptions}

返回: Promise<BundleListResult>


reset(options?: ResetOptions | undefined) => Promise<void>

将应用程序重置为 builtin (向苹果应用商店/谷歌-play商店发送的那个)或最后一次成功加载的捆绑包。

ParamType描述
optionsResetOptions包含 {@link} ResetOptions.toLastSuccessful}, true 重置为内置捆绑包,并且将重置为最后一次成功加载的捆绑包。 false Copy to clipboard

current()

current()
current() => Promise<CurrentBundleResult>

获取当前的包,如果没有设置则返回 builtin. currentNative 是设备上安装的原始包

返回: Promise<CurrentBundleResult>


reload()

reload()
reload() => Promise<void>

setMultiDelay(…)


setMultiDelay(…)

复制到剪贴板
setMultiDelay(options: MultiDelayConditions) => Promise<void>

设置一个 {@link} 延迟条件} date 延迟更新条件 background 延迟更新条件 nativeVersion 延迟更新条件 kill 延迟更新条件

延迟更新条件延迟更新条件延迟更新条件
optionsMultiDelayConditions参数类型描述 多重延迟条件设置多重延迟条件的数组

4.3.0


cancelDelay() => Promise<void>

取消一个延迟条件(@link DelayCondition) 获取最新(…)

标题:获取最新(…) 4.0.0


取消一个延迟条件(@link DelayCondition)

立即处理更新
getLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>

从更新 URL 获取最新的包

参数类型
optionsGetLatestOptions

返回值: Promise<LatestVersion>

自: 4.0.0


setChannel(options: SetChannelOptions) => Promise<ChannelRes>

设置此设备的插件管理的本地频道。频道必须 allow_device_self_set 验证频道与后端, 然后在设备上存储所选频道。它不会创建或更新后端设备的覆盖, 因此设备不会在__CAPGO_KEEP_0__控制台中显示为被覆盖。只有从控制台或公共__CAPGO_KEEP_1__创建的 assignments 才会在设备覆盖 UI 中显示。

setChannel() validates the channel with the backend, then stores the selected channel locally on the device. It does not create or update a backend Device Override, so the device will not appear as overridden in the Capgo dashboard. Only assignments created from the dashboard or the Public API are shown in the Device Override UI.

注意事项:

  • 不要在启动时使用此方法设置频道。请在您的__CAPGO_KEEP_0__配置中使用 defaultChannel in your Capacitor config instead.
  • 公共频道无法自行分配。
  • 如果一个频道被标记为 ,调用 public将返回错误。要使用公共频道,请调用 setChannel() - 设备将自动切换到匹配的公共频道。 unsetChannel() 使用
  • 来发现可用的频道以及它们是否允许自行分配。 listChannels() 参数
Param类型描述
optionsSetChannelOptions是否是 {@link 设置通道选项} 设置

返回: Promise<ChannelRes>

自: 4.7.0


unsetChannel(options: UnsetChannelOptions) => Promise<void>

清除本地设备的插件管理的通道。 这只清除本地存储的通道,不删除仪表板或公共 __CAPGO_KEEP_0__ 设备覆盖记录。 setChannel(); it does not delete Dashboard or Public API Device Override records.

在调用此方法后,正常渠道顺序适用:已有的仪表板或公共API设备覆盖优先级仍然有效;否则,设备可以回退到匹配公共/默认渠道的条件(平台、设备类型、构建类型)。

这在以下情况下很有用:

  • 您想将设备移动回默认更新跟踪
  • 您想使用公共渠道(由于公共渠道无法自行分配) setChannel())
参数类型
optionsUnsetChannelOptions

4.7.0


getChannel() => Promise<GetChannelRes>

获取此设备的渠道

返回: Promise<GetChannelRes>

自从: 4.8.0


listChannels()

listChannels()部分
listChannels() => Promise<ListChannelsResult>

列出此设备可用的所有频道。返回与设备当前环境(平台、模拟器/真实设备、开发/生产构建)兼容的频道,并且是公共频道或允许自我分配。

结果中的每个频道包括:

  • public如果 true,这是一个 默认频道。您无法使用 setChannel()将其分配给自己。相反,如果您使用 unsetChannel()删除您的频道分配,设备将自动从公共频道接收更新。
  • allow_self_set: 如果 true, 这是 自我分配的频道. You can explicitly assign the device to this channel using setChannel().

Returns: Promise<ListChannelsResult>

Since: 7.5.0


setCustomId(options: SetCustomIdOptions) => Promise<void>

为此设备设置一个自定义 ID

参数类型描述
optionsSetCustomIdOptions是 {@link} SetCustomIdOptions} 自定义 ID 以设置

自从: 4.9.0


getBuiltinVersion() => Promise<BuiltinVersion>

获取本机应用程序版本或在配置中设置的内置版本

返回: Promise<BuiltinVersion>

自从: 5.2.0


getDeviceId() => Promise<DeviceId>

获取设备唯一标识(用于自动更新服务器)

返回: Promise<DeviceId>


getPluginVersion() => Promise<PluginVersion>

获取本地Capacitor Updater 插件版本(用于自动更新服务器)

返回: Promise<PluginVersion>


isAutoUpdateEnabled() => Promise<AutoUpdateEnabled>

获取自动更新配置的状态。

返回: Promise<AutoUpdateEnabled>


removeAllListeners()

标题:removeAllListeners()
removeAllListeners() => Promise<void>

移除此插件的所有监听器。

自: 1.0.0


addListener('download', …)

标题:addListener('download', …)
addListener(eventName: 'download', listenerFunc: (state: DownloadEvent) => void) => Promise<PluginListenerHandle>

监听应用程序中的包下载事件。下载开始时、下载中和下载完成时触发一次。 此方法将返回下载进度百分比。

参数类型
eventName‘download’
listenerFunc(state: DownloadEvent) => void

返回值: Promise<PluginListenerHandle>

自: 2.0.11


添加监听器(‘无需更新’,…)

标题:添加监听器(‘无需更新’,…)
addListener(eventName: 'noNeedUpdate', listenerFunc: (state: NoNeedEvent) => void) => Promise<PluginListenerHandle>

监听无需更新事件,适用于每次启动应用时强制检查更新

参数类型
eventName‘noNeedUpdate’
listenerFunc(state: NoNeedEvent) => void

返回值: Promise<PluginListenerHandle>

自: 4.0.0


addListener(eventName: 'updateAvailable', listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle>

监听可用更新事件,适用于每次启动应用时强制检查

参数类型
eventName‘updateAvailable’
listenerFunc(state: UpdateAvailableEvent) => void

返回值: Promise<PluginListenerHandle>

自: 4.0.0


添加监听器(‘downloadComplete’,…)

Section titled “添加监听器(‘downloadComplete’,…)”
addListener(eventName: 'downloadComplete', listenerFunc: (state: DownloadCompleteEvent) => void) => Promise<PluginListenerHandle>

监听下载完成事件。

参数类型
eventName‘downloadComplete’
listenerFunc(state: DownloadCompleteEvent) => void

返回值: Promise<PluginListenerHandle>

自: 4.0.0


addListener(‘majorAvailable’,…)

标题:addListener(‘majorAvailable’,…)
addListener(eventName: 'majorAvailable', listenerFunc: (state: MajorAvailableEvent) => void) => Promise<PluginListenerHandle>

在 App 中监听重大更新事件,让您知道重大更新是否被禁用AutoUpdateBreaking设置

参数类型
eventName‘majorAvailable’
listenerFunc(state: MajorAvailableEvent) => void

返回值: Promise<PluginListenerHandle>

自: 2.3.0


addListener(eventName: 'updateFailed', listenerFunc: (state: UpdateFailedEvent) => void) => Promise<PluginListenerHandle>

在 App 中监听更新失败事件,让你知道下次启动 App 时更新安装失败

参数类型
eventName‘updateFailed’
listenerFunc(state: UpdateFailedEvent) => void

返回值: Promise<PluginListenerHandle>

Since: 2.3.0


添加监听器(‘downloadFailed’,…)

Section titled “添加监听器(‘downloadFailed’,…)”
addListener(eventName: 'downloadFailed', listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle>

在 App 中监听下载失败事件,让你知道某个包下载失败

参数类型
eventName‘downloadFailed’
listenerFunc(state: DownloadFailedEvent) => void

返回值: Promise<PluginListenerHandle>

自: 4.0.0


添加监听器(‘appReloaded’,…)

标题:添加监听器(‘appReloaded’,…)
addListener(eventName: 'appReloaded', listenerFunc: () => void) => Promise<PluginListenerHandle>

在 App 中监听重载事件,让你知道重载已经发生

参数类型
eventName‘appReloaded’
listenerFunc() => void

返回值: Promise<PluginListenerHandle>

自: 4.3.0


添加监听器(‘appReady’,…)

Section titled “addListener(‘appReady’, …)”
addListener(eventName: 'appReady', listenerFunc: (state: AppReadyEvent) => void) => Promise<PluginListenerHandle>

在 App 中监听 app ready 事件,让你知道 app 已经准备好使用

ParamType
eventName‘appReady’
listenerFunc(state: AppReadyEvent) => void

Returns: Promise<PluginListenerHandle>

Since: 5.1.0


isAutoUpdateAvailable() => Promise<AutoUpdateAvailable>

获取是否有自动更新可用(不受 serverUrl 禁用的影响)

Returns: Promise<AutoUpdateAvailable>


getNextBundle()

getNextBundle()
getNextBundle() => Promise<BundleInfo | null>

获取将在应用重载时使用的下一个捆绑包。 如果没有设置下一个捆绑包,则返回 null。

返回: Promise<BundleInfo | null>

自: 6.8.0


setShakeMenu(…)

setShakeMenu(…)
setShakeMenu(options: SetShakeMenuOptions) => Promise<void>

用于调试/测试目的启用或禁用抖动菜单

参数类型概述
optionsSetShakeMenuOptions包含一个布尔值来启用或禁用抖动菜单

自: 7.5.0


isShakeMenuEnabled()

标题:isShakeMenuEnabled()
isShakeMenuEnabled() => Promise<ShakeMenuEnabled>

获取抖动菜单的当前状态

返回: Promise<ShakeMenuEnabled>

自: 7.5.0


AppReadyResult

AppReadyResult
属性类型
bundleBundleInfo

应用程序信息

属性
类型更新 URL
idstring
versionstring
downloadedstring
checksumstring
statusBundleStatus

属性

类型
统计 URLSection titled “UpdateUrl”
urlstring

Section titled “BundleInfo”

StatsUrl
属性类型
urlstring

ChannelUrl

属性
类型下载选项
urlstring

此 URL 和版本用于从服务器下载捆绑包。如果您使用后端,则所有信息都将由 getLatest 方法提供。如果您不使用后端,则需要提供捆绑包的 URL 和版本。若捆绑包已使用 __CAPGO_KEEP_0__ 命令加密,则需要 SessionKey,应从该命令的结果中接收。

属性

This URL and versions are used to download the bundle from the server, If you use backend all information will be given by the method getLatest. If you don’t use backend, you need to provide the URL and version of the bundle. SessionKey are required if you encrypted the bundle with the CLI command encrypt, you should receive them as result of the command.

下载选项此 URL 和版本用于从服务器下载捆绑包。如果您使用后端,则所有信息都将由 getLatest 方法提供。如果您不使用后端,则需要提供捆绑包的 URL 和版本。若捆绑包已使用 __CAPGO_KEEP_0__ 命令加密,则需要 SessionKey,应从该命令的结果中接收。描述默认
urlstring要下载的捆绑包 zip 文件的 URL(例如:dist.zip)。(这可以是任何 URL。例如:Amazon S3,一个 GitHub 标签,任何您托管的捆绑包的其他地方。)
versionstring捆绑包的版本 code/名称
sessionKeystring当捆绑包使用会话密钥加密时,更新的会话密钥undefined4.0.0
checksumstring捆绑包的校验和,应为 sha256,如果捆绑包加密,则应使用私钥加密undefined4.0.0
manifestManifestEntry[]Delta(manifest)多文件下载的清单undefined6.1.0
属性类型
file_namestring | null
file_hashstring | null
download_urlstring | null

BundleId

BundleId
属性类型
idstring

BundleListResult

BundleListResult
属性类型
bundlesBundleInfo[]

ListOptions

ListOptions
属性类型描述默认
rawboolean是否返回原始包列表或清单。如果为真,列表将尝试读取内部数据库而不是磁盘上的文件。false6.14.0
属性类型
toLastSuccessfulboolean
属性类型
bundleBundleInfo
nativestring

多重延迟条件

多重延迟条件部分
属性类型
delayConditionsDelayCondition[]

延迟条件

延迟条件部分
属性类型描述
kindDelayUntilNext设置多重延迟条件
valuestring

最新版本

最新版本部分
属性类型描述
versionstringgetLatest方法的返回结果4.0.0
checksumstring6
majorboolean
messagestring
sessionKeystring
errorstring
oldstring
urlstring
manifestManifestEntry[]6.1
属性类型描述默认值
channelstring获取最新版本的频道undefined6.8.0

ChannelRes

频道资源
PropType描述Since
statusstring设置频道的当前状态4.7.0
errorstring
messagestring

SetChannelOptions

设置频道选项
PropType
channelstring
triggerAutoUpdateboolean

UnsetChannelOptions

UnsetChannelOptions
属性类型
triggerAutoUpdateboolean

获取频道结果

属性
类型描述获取频道的当前状态
channelstringListChannelsResult4.8.0
errorstring
messagestring
statusstring
allowSetboolean
属性类型描述
channelsChannelInfo[]可用的渠道列表7.5.0
属性类型描述
idnumberThe numeric channel ID7.5.0
namestringThe channel name7.5.0
publicboolean如果为 true,则这是一个默认/备用频道。设备无法自行将其分配到公共频道。相反,当设备移除其频道覆盖(使用“”),它将自动从匹配的公共频道接收更新。 unsetChannel()如果为 true,设备可以使用“”显式将其分配到此频道。通常用于 beta 测试、 A/B 测试或优选更新跟踪。7.5.0
allow_self_setboolean频道命令使用频道“”,而不是此数字“”。 setChannel()SetCustomIdOptions7.5.0

标题:SetCustomIdOptions name属性 id.

pagePathtargetLanguage
customIdstring

内置版本

内置版本
属性类型
versionstring

设备 ID

设备 ID
属性类型
deviceIdstring

插件版本

插件版本
属性类型
versionstring

自动更新开关

自动更新开关
属性类型
enabledboolean

插件监听器句柄

属性
类型下载事件
remove() => Promise<void>

属性

类型
下载事件属性概述
percentnumber下载进度,范围为0到100。4.0.0
bundleBundleInfo

无需事件

无需事件
属性类型概述
bundleBundleInfo下载进度,范围为0到100。4.0.0
属性类型描述
bundleBundleInfo下载进度,范围为 0 到 100。4.0.0

下载完成事件

下载完成事件
属性类型描述
bundleBundleInfo当有新更新可用时触发4.0.0

主要可用事件

主要可用事件
属性类型描述
versionstring当有新主要捆绑包可用时触发。4.0.0

更新失败事件

主要可用事件
属性类型描述自从
bundleBundleInfo安装更新失败时触发。4.0.0

下载失败事件

下载失败事件
属性类型描述自从
versionstring下载失败时触发。4.0.0

应用就绪事件

属性
section类型描述
bundleBundleInfo当应用程序准备好使用时发出。5.2.0
statusstring

自动更新可用

标题:自动更新可用
属性类型
availableboolean

设置摇动菜单选项

标题:设置摇动菜单选项
属性类型
enabledboolean

ShakeMenuEnabled

ShakeMenuEnabled
属性类型
enabledboolean

类型别名

类型别名

Bundle状态

Bundle状态

等待:包正在等待下一个包。 下载中:包正在下载中。 成功:包已下载并准备好作为下一个包。 SET SET Bundle状态 作为下一个捆绑包。 错误:捆绑包下载失败。

‘success’ | ‘error’ | ‘pending’ | ‘downloading’

延迟到下一个

标题:延迟到下一个

‘background’ | ‘kill’ | ‘nativeVersion’ | ‘date’

继续从功能和设置

标题:继续从功能和设置

如果您正在使用 功能和设置 来规划仪表板和API操作,连接它与 使用@capgo/capacitor-updater 为native能力在使用@capgo/capacitor-updater API概述 为实现细节在API概述, 简介 为简介中的实现细节 API 键 为API 键中的实现细节, 和 设备 为设备中的实现细节。