功能和设置
__CAPGO_KEEP_4__
__CAPGO_KEEP_11__
Updater 插件配置查看更多信息:Github README 更多信息,请参阅README。
CapacitorUpdater 可以使用以下选项进行配置:
| 属性 | 类型 | 描述 | 默认值 | 自 |
|---|---|---|---|---|
appReadyTimeout | number | 配置 native 插件在等待更新之前等待的毫秒数。可用于 Android、iOS 和 Electron。 | 10000 // (10 seconds) | |
responseTimeout | number | 配置 native 插件在等待 API 超时之前等待的毫秒数。可用于 Android、iOS 和 Electron。 | 20000 // (20 seconds) | |
autoDeleteFailed | boolean | Configure whether the plugin should automatically delete failed bundles. Available on Android, iOS, and Electron. | true | |
autoDeletePrevious | boolean | Configure whether the plugin should automatically delete previous bundles after a successful update. Available on Android, iOS, and Electron. | true | |
autoUpdate | boolean | ‘off’ | ‘atBackground’ | ‘atInstall’ | ‘onLaunch’ | ‘always’ | ‘onlyDownload’ | Configure how the plugin should use Auto Update via an update server. true is the same as “atBackground”; false is the same as “off”. - off: Disable Auto Update - atBackground: Check and download automatically, then apply when the app moves to the background - atInstall: Apply immediately only after a fresh install or native app update, otherwise use atBackground - onLaunch: Apply immediately on launch, otherwise use atBackground after the launch check - always: Apply immediately whenever Auto Update runs - onlyDownload: Check and download automatically, emit updateAvailable, and never set the next bundle automatically. Available on Android, iOS, and Electron. | ”atBackground” // true is still accepted | |
resetWhenUpdate | boolean | Automatically delete previous downloaded bundles when a newer native app bundle is installed to the device. Available on Android, iOS, and Electron. | true | |
updateUrl | string | Configure the URL / endpoint to which update checks are sent. Available on Android, iOS, and Electron. | https://plugin.capgo.app/updates | |
channelUrl | string | Configure the URL / endpoint for channel operations. Available on Android, iOS, and Electron. | https://plugin.capgo.app/channel_self | |
statsUrl | string | Configure the URL / endpoint to which update statistics are sent. Available on Android, iOS, and Electron. Set to "" to disable stats reporting. | https://plugin.capgo.app/stats | |
publicKey | string | Configure the public key for end to end live update encryption Version 2. Available on Android, iOS, and Electron. | undefined | 6.2.0 |
version | string | Configure the current version of the app. This will be used for the first update request. If not set, the plugin will get the version from the native code. Available on Android, iOS, and Electron. | undefined | 4.17.48 |
directUpdate | boolean | ‘always’ | ‘atInstall’ | ‘onLaunch’ | 已弃用。请使用“atInstall”,“onLaunch”或“always”模式代替: - false:永不进行直接更新 - atInstall:与autoUpdate:“atInstall”相同 - onLaunch:与autoUpdate:“onLaunch”相同 - always:与autoUpdate:“always”相同 - true:与“always”相同(为了向后兼容)。 Available on Android, iOS, and Electron. | false | 5.1.0 |
autoSplashscreen | boolean | 自动处理使用即时应用模式的启动屏幕隐藏。 当启用时,插件将在更新应用程序或无需更新时自动隐藏启动屏幕。 这消除了手动监听appReady事件并调用SplashScreen.hide()的需要。 只有在autoUpdate设置为“atInstall”,“onLaunch”或“always”时才有效。 Legacy directUpdate值仍然支持为向后兼容。 需要@capacitor/splash-screen插件安装并配置launchAutoHide:false。 需要启用自动更新。 Available on Android and iOS. | false | 7.6.0 |
periodCheckDelay | number | 配置周期性更新检查的延迟时间。单位为秒。 Available on Android, iOS, and Electron。 不能小于600秒(10分钟)。 | 600 // (10 minutes) | |
localS3 | boolean | 配置CLI以使用本地服务器进行测试或自托管更新服务器. | undefined | 4.17.48 |
localHost | string | 配置CLI以使用本地服务器进行测试或自托管更新服务器. | undefined | 4.17.48 |
localWebHost | string | 配置CLI以使用本地服务器进行测试或自托管更新服务器. | undefined | 4.17.48 |
localSupa | string | 配置CLI以使用本地服务器进行测试或自托管更新服务器. | undefined | 4.17.48 |
localSupaAnon | string | 配置CLI以使用本地服务器进行测试. | undefined | 4.17.48 |
localApi | string | 配置CLI以使用本地api进行测试. | undefined | 6.3.3 |
localApiFiles | string | 配置CLI以使用本地文件api进行测试. | undefined | 6.3.3 |
allowModifyUrl | boolean | 允许插件动态从JavaScript端修改updateUrl、statsUrl和channelUrl。 | false | 5.4.0 |
defaultChannel | string | 设置应用程序的默认频道在配置中。大小写敏感。这将设置将覆盖云中设置的默认频道,但仍将尊重云中设置的覆盖项。 | undefined | 5.5.0 |
appId | string | 配置应用程序ID在配置中。 | undefined | 6.0.0 |
keepUrlPathAfterReload | boolean | 配置插件以在重载后保留URL路径。警告:当触发重载时,‘window.history’将被清除。 | false | 6.8.0 |
disableJSLogging | boolean | 禁用插件的JavaScript日志。如果为true,插件将不会在JavaScript控制台中记录。只有本机日志会被执行。 | false | 7.3.0 |
shakeMenu | boolean | 通过摇晃手势显示更新菜单(用于调试/测试目的) | false | 7.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()setUpdateUrl(...)setStatsUrl(...)setChannelUrl(...)download(...)next(...)set(...)delete(...)list(...)reset(...)current()reload()setMultiDelay(...)cancelDelay()getLatest(...)setChannel(...)unsetChannel(...)getChannel()listChannels()setCustomId(...)getBuiltinVersion()getDeviceId()getPluginVersion()isAutoUpdateEnabled()removeAllListeners()addListener('download', ...)addListener('noNeedUpdate', ...)addListener('updateAvailable', ...)addListener('downloadComplete', ...)addListener('majorAvailable', ...)addListener('updateFailed', ...)addListener('downloadFailed', ...)addListener('appReloaded', ...)addListener('appReady', ...)isAutoUpdateAvailable()getNextBundle()setShakeMenu(...)isShakeMenuEnabled()- 接口
- 类型别名
方法
方法部分notifyAppReady()
“notifyAppReady()”notifyAppReady() => Promise<AppReadyResult>通知Capacitor更新器当前包正在运行(如果不在每次应用启动时调用此方法,则会发生回滚) 默认情况下,此方法应在应用启动后第 10 秒内调用,否则会发生回滚。 可以通过 {@link appReadyTimeout} 来更改此行为
返回: Promise<AppReadyResult>
setUpdateUrl(…)
“setUpdateUrl(…)setUpdateUrl(options: UpdateUrl) => Promise<void>设置应用更新的 URL,这将用于检查更新。
| 参数 | 类型 | 描述 |
|---|---|---|
options | UpdateUrl | 包含用于检查更新的 URL。 |
自从: 5.4.0
__CAPGO_KEEP_0__
自从:__CAPGO_KEEP_0__setStatsUrl(options: StatsUrl) => Promise<void>设置应用程序的statsUrl,用于发送统计数据。传入一个空字符串将禁用统计数据收集。
| 参数 | 类型 | 描述 |
|---|---|---|
options | StatsUrl | 包含用于发送统计数据的URL。 |
自从: 5.4.0
自从:__CAPGO_KEEP_0__
自从:__CAPGO_KEEP_0__setChannelUrl(options: ChannelUrl) => Promise<void>设置应用的channelUrl,这将用于设置频道。
| 参数 | 类型 | 描述 |
|---|---|---|
options | ChannelUrl | 包含用于设置频道的URL。 |
自: 5.4.0
download(…)
标题为“download(…)download(options: DownloadOptions) => Promise<BundleInfo>从提供的URL下载一个新的包,应该是一个zip文件,或者一个唯一id的包,包含所有文件
| 参数 | 类型 | 描述 |
|---|---|---|
options | DownloadOptions | The {@link 下载选项用于下载一个新的bundle zip。 |
返回: Promise<BundleInfo>
next(…)
标题:next(…)next(options: BundleId) => Promise<BundleInfo>设置下次重载应用时使用的bundle。
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 包含下一次应用启动时设置的下一个捆绑包的 ID。 {@link 捆绑包信息.id} |
返回: Promise<BundleInfo>
set(…)
标题: “set(…)set(options: BundleId) => Promise<void>设置当前捆绑包并立即重新加载应用。
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 一个 {@link BundleId包含新 Bundle ID 的对象,设置为当前。 |
delete(…)
标题:删除(…)delete(options: BundleId) => Promise<void>从原生应用存储中删除指定的 Bundle。使用 {@link list} 来获取存储的 Bundle ID。
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 一个 {@link BundleId} 对象,包含要删除的 Bundle ID(注意,这是 Bundle ID,而不是版本名称) |
list(…)
列表(…)list(options?: ListOptions | undefined) => Promise<BundleListResult>获取本地下载的所有包
| 参数 | 类型 | 描述 |
|---|---|---|
options | ListOptions | 用于列出包的 {@link ListOptions} 返回:reset(…) |
用于列出包的配置选项 Promise<BundleListResult>
reset(options?: ResetOptions | undefined) => Promise<void>将应用程序重置为 builtin 应用程序包(发送到 Apple App Store / Google Play Store)或最后成功加载的包。
| 参数 | 类型 | 描述 |
|---|---|---|
options | ResetOptions | 包含 {@link ResetOptions.toLastSuccessful}, true 重置为内置包,并 false 将重置为最后成功加载的包。 |
current()
Section titled “current()”current() => Promise<CurrentBundleResult>获取当前的 bundle,如果没有设置则返回 builtin. currentNative 是设备上安装的原始 bundle
返回: Promise<CurrentBundleResult>
reload()
Section titled “reload()”reload() => Promise<void>重新加载视图
setMultiDelay(…)
Section titled “setMultiDelay(…)”setMultiDelay(options: MultiDelayConditions) => Promise<void>设置一个 {@link DelayCondition} 数组,包含 Plugin 将使用的延迟更新条件。
当所有条件都满足后,更新过程将重新启动,通常的更新安装过程将在后台或杀死应用后继续。
对于 "kind",值应为 ISO8601 日期字符串。
对于 "kind",值应为毫秒数。
对于 "kind",值应为版本号。
对于 "kind",值不被使用。
该函数在选项 "kill" 时存在不一致的行为,杀死应用后会触发更新,而不是在下一次后台运行时。
此问题将在未来一个主要版本中得到修复。
参数 类型描述 date 包含 {@link MultiDelayConditions} background Param nativeVersion Type kill Description
| Containing the {@link MultiDelayConditions} | DelayCondition | array |
|---|---|---|
options | MultiDelayConditions | An array of conditions that the Plugin will use to delay the update. For the "kind" field, the value should be an iso8601 date string. For the "kind" field, the value should be a number in milliseconds. For the "kind" field, the value should be the version number. For the "kind" field, the value is not used. This function has inconsistent behavior when the option "kill" is used, it will trigger the update after the first kill and not after the next background like other options. This will be fixed in a future major release. DelayCondition条件数组来设置 |
自从: 4.3.0
cancelDelay()
标题:“cancelDelay()”cancelDelay() => Promise<void>取消一个 {@link DelayCondition} 来立即处理更新。 自从:getLatest(…)
标题:“getLatest(…) 4.0.0
复制到剪贴板
自从:getLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>获取最新的 bundle 可从更新 URL 中获取
| 参数 | 类型 |
|---|---|
options | GetLatestOptions |
返回值: Promise<LatestVersion>
自: 4.0.0
setChannel(…)
标题:“setChannel(…)setChannel(options: SetChannelOptions) => Promise<ChannelRes>设置设备的通道。通道必须 allow_device_self_set 为此功能启用。
重要注意事项:
- 不要在启动时使用此方法设置通道。使用
defaultChannel在您的Capacitor配置中代替。 - 此方法适用于应用程序准备就绪且用户已交互(例如,选择参加beta测试)后使用。
- 公共频道无法自行分配。 如果一个频道被标记为
public,调用setChannel()将返回错误。要使用公共频道,请调用unsetChannel()- 设备将自动切换到匹配的公共频道。 - 使用
listChannels()来发现哪些频道可用并是否允许自行分配。
| 参数 | 类型 | 描述 |
|---|---|---|
options | SetChannelOptions | 是否设置 '{@link' 设置通道选项返回: |
自 Promise<ChannelRes>
unsetChannel(…) 4.7.0
标题:unsetChannel(…)
复制到剪贴板unsetChannel(options: UnsetChannelOptions) => Promise<void>公共通道 接收更新。 此功能在以下情况下有用:
__CAPGO_KEEP_0__
- 您想将设备恢复到默认的更新通道
- 您想使用公共频道(由于公共频道无法自行分配,因此需要通过
setChannel())
| Param | Type |
|---|---|
options | UnsetChannelOptions |
自: 4.7.0
getChannel()
标题:getChannel()getChannel() => Promise<GetChannelRes>获取该设备的频道
返回: Promise<GetChannelRes>
自: 4.8.0
listChannels()
Section titled “listChannels()”listChannels() => Promise<ListChannelsResult>获取此设备可用的所有频道列表。返回与设备当前环境(平台、模拟器/真实设备、开发/生产构建)兼容的频道,且为公共频道或允许自我分配。
结果中的每个频道包括:
public: 如果true,这是一个 默认频道。您无法使用setChannel()将其设置为自我分配。相反,如果您使用unsetChannel()移除您的频道分配,设备将自动从公共频道接收更新。allow_self_set: 如果true,这是一个 自定义频道您可以使用以下方法显式地将设备分配到此频道setChannel().
返回: Promise<ListChannelsResult>
自 7.5.0
自定义ID(setCustomId(…))
复制到剪贴板setCustomId(options: SetCustomIdOptions) => Promise<void>参数
| 类型 | 描述 | 是 {@link} |
|---|---|---|
options | SetCustomIdOptions | 自定义频道 设置自定义ID选项} 设置自定义ID |
自从: 4.9.0
获取内置版本()
标题:获取内置版本()getBuiltinVersion() => Promise<BuiltinVersion>获取本机应用程序版本或配置中设置的内置版本
返回: Promise<BuiltinVersion>
自从: 5.2.0
获取设备ID()
标题:获取设备ID()getDeviceId() => Promise<DeviceId>获取用于识别设备的唯一 ID(发送到自动更新服务器)
返回: Promise<DeviceId>
getPluginVersion()
节标题 “getPluginVersion()”getPluginVersion() => Promise<PluginVersion>获取本机 Capacitor Updater 插件版本(发送到自动更新服务器)
返回: Promise<PluginVersion>
isAutoUpdateEnabled()
节标题 “isAutoUpdateEnabled()”isAutoUpdateEnabled() => Promise<AutoUpdateEnabled>获取自动更新配置的状态。
返回: Promise<AutoUpdateEnabled>
removeAllListeners()
Section titled “removeAllListeners()”removeAllListeners() => Promise<void>移除此插件的所有监听器。
Since: 1.0.0
addListener(‘download’, …)
Section titled “addListener(‘download’, …)”addListener(eventName: 'download', listenerFunc: (state: DownloadEvent) => void) => Promise<PluginListenerHandle>监听 App 下载事件。下载开始、下载中和下载完成时触发一次。 此事件将返回下载进度。
| 参数 | 类型 |
|---|---|
eventName | ’download’ |
listenerFunc | (state: DownloadEvent) => void |
返回: Promise<PluginListenerHandle>
自从: 2.0.11
addListener(‘noNeedUpdate’, …)
标题:添加监听器(‘noNeedUpdate’,…)addListener(eventName: 'noNeedUpdate', listenerFunc: (state: NoNeedEvent) => void) => Promise<PluginListenerHandle>在应用程序启动时每次都强制检查更新,非常有用
| 参数 | 类型 |
|---|---|
eventName | ’noNeedUpdate’ |
listenerFunc | (state: NoNeedEvent) => void |
返回: Promise<PluginListenerHandle>
自从: 4.0.0
addListener(‘updateAvailable’, …)
标题:添加监听器(‘updateAvailable’,…)addListener(eventName: 'updateAvailable', listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle>Listen for available update event, useful when you want to force check every time the app is launched
| Param | Type |
|---|---|
eventName | ’updateAvailable’ |
listenerFunc | (state: UpdateAvailableEvent) => void |
Returns: Promise<PluginListenerHandle>
Since: 4.0.0
addListener(‘downloadComplete’, …)
下载完成事件监听addListener(eventName: 'downloadComplete', listenerFunc: (state: DownloadCompleteEvent) => void) => Promise<PluginListenerHandle>Listen for downloadComplete events.
| Param | Type |
|---|---|
eventName | ’downloadComplete’ |
listenerFunc | (state: DownloadCompleteEvent) => void |
Returns: Promise<PluginListenerHandle>
自: 4.0.0
addListener(‘majorAvailable’,…)
标题:添加监听器(‘majorAvailable’,…)addListener(eventName: 'majorAvailable', listenerFunc: (state: MajorAvailableEvent) => void) => Promise<PluginListenerHandle>在 App 中监听重大更新事件,让您知道重大更新是否被禁用
| 参数 | 类型 |
|---|---|
eventName | ’majorAvailable’ |
listenerFunc | (state: MajorAvailableEvent) => void |
返回: Promise<PluginListenerHandle>
自: 2.3.0
addListener(‘updateFailed’,…)
标题:添加监听器(‘updateFailed’,…)addListener(eventName: 'updateFailed', listenerFunc: (state: UpdateFailedEvent) => void) => Promise<PluginListenerHandle>在 App 中监听更新失败事件,让你知道下次启动 App 时更新安装失败
| 参数 | 类型 |
|---|---|
eventName | ’updateFailed’ |
listenerFunc | (state: UpdateFailedEvent) => void |
返回值: Promise<PluginListenerHandle>
自: 2.3.0
addListener(‘downloadFailed’,…)
标题:addListener(‘downloadFailed’,…)addListener(eventName: 'downloadFailed', listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle>在 App 中监听下载失败事件,让你知道一个包下载失败
| 参数 | 类型 |
|---|---|
eventName | ’downloadFailed’ |
listenerFunc | (state: DownloadFailedEvent) => void |
返回值: Promise<PluginListenerHandle>
自: 4.0.0
addListener(‘appReloaded’,…)
标题:addListener(‘appReloaded’,…)addListener(eventName: 'appReloaded', listenerFunc: () => void) => Promise<PluginListenerHandle>在 App 中监听重载事件,让你知道何时发生重载
| 参数 | 类型 |
|---|---|
eventName | ’appReloaded’ |
listenerFunc | () => void |
返回: Promise<PluginListenerHandle>
自: 4.3.0
addListener(‘appReady’,…)
标题:addListener(‘appReady’,…)addListener(eventName: 'appReady', listenerFunc: (state: AppReadyEvent) => void) => Promise<PluginListenerHandle>Listen for app ready event in the App, let you know when app is ready to use
| Param | Type |
|---|---|
eventName | ’appReady’ |
listenerFunc | (state: AppReadyEvent) => void |
Returns: Promise<PluginListenerHandle>
Since: 5.1.0
isAutoUpdateAvailable()
Section titled “”isAutoUpdateAvailable() => Promise<AutoUpdateAvailable>Get if auto update is available (not disabled by serverUrl).
Returns: Promise<AutoUpdateAvailable>
getNextBundle()
Section titled “”getNextBundle() => Promise<BundleInfo | null>当应用重新加载时,将使用的下一个捆绑包。 如果没有设置下一个捆绑包,则返回 null。
返回: Promise<BundleInfo | null>
自从: 6.8.0
setShakeMenu(…)
标题:setShakeMenu(…)setShakeMenu(options: SetShakeMenuOptions) => Promise<void>用于调试/测试目的启用或禁用抖动菜单
| 参数 | 类型 | 描述 |
|---|---|---|
options | SetShakeMenuOptions | 包含启用或禁用抖动菜单的布尔值 |
自从: 7.5.0
是否启用摇动菜单()
标题:是否启用摇动菜单()isShakeMenuEnabled() => Promise<ShakeMenuEnabled>获取当前摇动菜单状态
返回: Promise<ShakeMenuEnabled>
自从: 7.5.0
接口
标题:接口应用就绪结果
标题:应用就绪结果| 属性 | 类型 |
|---|---|
bundle | BundleInfo |
打包信息
打包信息| 属性 | 类型 |
|---|---|
id | string |
version | string |
downloaded | string |
checksum | string |
status | BundleStatus |
更新地址
更新地址| 属性 | 类型 |
|---|---|
url | string |
统计地址
统计地址| 属性 | 类型 |
|---|---|
url | string |
__CAPGO_KEEP_0__
频道URL| 属性 | 类型 |
|---|---|
url | string |
下载选项
频道URLThis 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.
| 类型 | 描述 | 默认值 | 如果您使用后端,所有信息将由方法getLatest提供。如果您不使用后端,则需要提供包的URL和版本。若您使用__CAPGO_KEEP_0__命令加密包,请提供会话密钥,若加密结果,则应从命令结果中获取会话密钥。 | 由于 |
|---|---|---|---|---|
url | string | 此包的下载地址(例如:dist.zip)。(此地址可以是任何URL。例如:Amazon S3,一个 GitHub 标签,或者您已经托管的包的任何其他地方。 | ||
version | string | 此包的版本 code/name | ||
sessionKey | string | 此包的更新会话密钥,包是用会话密钥加密的 | undefined | 4.0.0 |
checksum | string | 此包的更新校验和,应为sha256并且如果包是加密的,则应使用私钥加密 | undefined | 4.0.0 |
manifest | ManifestEntry[] | Delta(manifest)多文件下载的清单 | undefined | 6.1.0 |
清单项
清单项| 属性 | 类型 |
|---|---|
file_name | string | null |
file_hash | string | null |
download_url | string | null |
包ID
包ID| 属性 | 类型 |
|---|---|
id | string |
捆绑列表结果
捆绑列表结果| 属性 | 类型 |
|---|---|
bundles | BundleInfo[] |
列表选项
列表选项| 描述 | 默认值 | __CAPGO_KEEP_0__ | __CAPGO_KEEP_0__ | 是否返回原始包列表或清单。如果为真,列表将尝试读取内部数据库而不是磁盘上的文件。 |
|---|---|---|---|---|
raw | boolean | 重置选项 | false | 6.14.0 |
重置选项
属性| 类型 | 当前包结果 |
|---|---|
toLastSuccessful | boolean |
当前包结果
属性| 类型 | 多延迟条件 |
|---|---|
bundle | BundleInfo |
native | string |
多延迟条件属性
类型| 属性 | 类型 |
|---|---|
delayConditions | DelayCondition[] |
__CAPGO_KEEP_0__
延迟条件| 属性 | 类型 | __CAPGO_KEEP_0__ |
|---|---|---|
kind | DelayUntilNext | 设置多个延迟条件 |
value | string |
最新版本
延迟条件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | getLatest方法的结果 | 4.0.0 |
checksum | string | 6 | |
major | boolean | ||
message | string | ||
sessionKey | string | ||
error | string | ||
old | string | ||
url | string | ||
manifest | ManifestEntry[] | 6.1 |
GetLatestOptions
标题:GetLatestOptions| 属性 | 类型 | 描述 | 默认值 | 自 |
|---|---|---|---|---|
channel | string | 获取最新版本的渠道 The channel must allow ‘self_assign’ for this to work | undefined | 6.8.0 |
ChannelRes
频道设置| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
status | string | 当前设置的频道状态 | 4.7.0 |
error | string | ||
message | string |
设置频道选项
设置频道选项| 属性 | 类型 |
|---|---|
channel | string |
triggerAutoUpdate | boolean |
取消设置频道选项
取消设置频道选项| 属性 | 类型 |
|---|---|
triggerAutoUpdate | boolean |
获取频道结果
获取频道结果| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
channel | string | 获取频道当前状态 | 4.8.0 |
error | string | ||
message | string | ||
status | string | ||
allowSet | boolean |
ListChannelsResult
获取频道结果| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
channels | ChannelInfo[] | 可用渠道列表 | 7.5.0 |
ChannelInfo
渠道信息| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
id | number | 渠道ID | 7.5.0 |
name | string | 渠道名称 | 7.5.0 |
public | boolean | 如果为 true,则这是一个默认/备用通道。设备无法自行将其分配到公共通道。相反,当设备移除其通道覆盖(使用“”)时,它将自动从匹配的公共通道接收更新。 unsetChannel()如果为 true,则设备可以使用“”显式将其分配到此通道。通常用于 beta 测试、A/B 测试或优选更新跟踪。 | 7.5.0 |
allow_self_set | boolean | 通道命令使用通道“”,而不是此数字“”。 setChannel()SetCustomIdOptions | 7.5.0 |
标题:SetCustomIdOptions nameProp id.
Type
BuiltinVersion| 标题:BuiltinVersion | If true, devices can explicitly self-assign to this channel using __CAPGO_KEEP_0__. This is typically used for beta testing, A/B testing, or opt-in update tracks. |
|---|---|
customId | string |
Channel commands use the channel __CAPGO_KEEP_0__, not this numeric __CAPGO_KEEP_1__.
SetCustomIdOptions| 属性 | 类型 |
|---|---|
version | string |
设备ID
设备ID| 属性 | 类型 |
|---|---|
deviceId | string |
插件版本
插件版本| 属性 | 类型 |
|---|---|
version | string |
自动更新
自动更新| 属性 | 类型 |
|---|---|
enabled | boolean |
插件监听器句柄
插件监听器句柄| 属性 | 类型 |
|---|---|
remove | () => Promise<void> |
下载事件
下载事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
percent | number | 下载进度,范围为 0 到 100。 | 4.0.0 |
bundle | BundleInfo |
NoNeedEvent
无需事件| Prop | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 下载进度,范围为 0 到 100。 | 4.0.0 |
UpdateAvailableEvent
更新可用事件| Prop | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 下载进度,范围为 0 到 100。 | 4.0.0 |
下载完成事件
下载完成事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 当有新更新可用时触发。 | 4.0.0 |
重大更新事件
重大更新事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | 当有新主要捆绑包可用时发射。 | 4.0.0 |
UpdateFailedEvent
标题:UpdateFailedEvent| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 安装更新失败时发射。 | 4.0.0 |
下载失败事件
下载失败事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | 下载失败时触发 | 4.0.0 |
应用就绪事件
下载失败事件| 属性 | 类型 | 描述 | 自从 |
|---|---|---|---|
bundle | BundleInfo | 应用程序准备好使用时发出。 | 5.2.0 |
status | string |
自动更新可用
自动更新可用| 属性 | 类型 |
|---|---|
available | boolean |
设置抖动菜单选项
设置抖动菜单选项| 属性 | 类型 |
|---|---|
enabled | boolean |
抖动菜单启用
抖动菜单启用| 属性 | 类型 |
|---|---|
enabled | boolean |
类型别名
类型别名打包状态
打包状态pending: 打包正在等待... SET 下一个打包即将下载中... SET 下一个打包下载完成,准备就绪...
‘success’ | ‘error’ | ‘pending’ | ‘downloading’
SET
延迟到下一次‘background’ | ‘kill’ | ‘nativeVersion’ | ‘date’
从功能和设置继续
从功能和设置继续如果您正在使用 功能和设置 来规划仪表板和API操作,连接它到 使用@capgo/capacitor-updater 使用@capgo/capacitor-updater API概述 API概述 介绍 介绍 API 键 为 API 键的实现细节提供键值对, 设备 为设备的实现细节提供键值对,