功能和设置
复制一个包含安装步骤和此插件的完整Markdown指南的设置提示。
Updater Plugin Config
Section titled “Updater Plugin Config”See the Github Readme for more information.
CapacitorUpdater 可以使用以下选项进行配置:
| Prop | Type | Description | Default | Since |
|---|---|---|---|---|
appReadyTimeout | number | native 插件在等待更新失败之前应等待的毫秒数。可用于 Android、iOS 和 Electron。 | 10000 // (10 seconds) | |
responseTimeout | number | 配置 native 插件等待 API 毫秒数后考虑超时。可用于 Android、iOS 和 Electron。 | 20000 // (20 seconds) | |
autoDeleteFailed | boolean | 配置是否使用自动删除失败的包。可用于 Android、iOS 和 Electron。 | true | |
autoDeletePrevious | boolean | 配置是否使用自动删除之前的包更新后。可用于 Android、iOS 和 Electron。 | true | |
autoUpdate | boolean | ‘off’ | ‘atBackground’ | ‘atInstall’ | ‘onLaunch’ | ‘always’ | ‘onlyDownload’ | 配置如何使用 Auto Update 通过更新服务器。true 与“atBackground”相同;false 与“off”相同。- off:禁用 Auto Update- atBackground:在应用程序移动到后台时自动检查和下载,然后在应用程序移动到后台时应用- atInstall:仅在新安装或原生应用程序更新后立即应用,否则使用 atBackground- onLaunch:在启动时立即应用,否则在启动检查后使用 atBackground- always:在 Auto Update 运行时立即应用- onlyDownload:自动检查和下载,发出 updateAvailable,永不设置下一个包自动。可用于 Android、iOS 和 Electron。 | ”atBackground” // true is still accepted | |
resetWhenUpdate | boolean | 在设备上安装新 native 应用程序包时,自动删除之前下载的包。可用于 Android、iOS 和 Electron。 | true | |
updateUrl | string | 配置更新检查的 URL / 端点。可用于 Android、iOS 和 Electron。 | https://plugin.capgo.app/updates | |
channelUrl | string | 配置通道操作的 URL / 端点。可用于 Android、iOS 和 Electron。 | https://plugin.capgo.app/channel_self | |
statsUrl | string | 配置 URL / 端点以发送更新统计信息。可用于 Android、iOS 和 Electron。设置为 "" 以禁用统计报告。 | https://plugin.capgo.app/stats | |
publicKey | string | 配置用于端到端实时更新加密的公钥。版本 2。可用于 Android、iOS 和 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”模式代替:autoUpdate。该选项仍支持现有应用程序。- false:永远不进行直接更新- atInstall:与 autoUpdate:“atInstall”相同- onLaunch:与 autoUpdate:“onLaunch”相同- always:与 autoUpdate:“always”相同- true:与“always”相同,以便于向后兼容。可用于 Android、iOS 和 Electron。 | false | 5.1.0 |
autoSplashscreen | boolean | 使用即时应用模式时,自动处理启动屏幕隐藏。启用后,插件将在更新应用或无需更新时自动隐藏启动屏幕。这消除了手动监听 appReady 事件并调用 SplashScreen.hide() 的需要。仅在 autoUpdate 设置为 “atInstall”、“onLaunch” 或 “always” 时有效。遗留 directUpdate 值仍支持向后兼容。需要 @capacitor/splash-screen 插件安装并配置 launchAutoHide:false。需要启用自动更新。可用于 Android 和 iOS。 | false | 7.6.0 |
periodCheckDelay | number | 配置延迟更新检查的时间间隔,单位为秒。可用于 Android、iOS 和 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以使用本地__CAPGO_KEEP_1__进行测试。 | undefined | 4.17.48 |
localApi | string | 配置CLI以使用本地文件api进行测试。 | undefined | 6.3.3 |
localApiFiles | string | Configure the CLI to use a local file api for testing. | undefined | 6.3.3 |
allowModifyUrl | boolean | 设置应用程序在配置中的默认频道。区分大小写。这将设置将覆盖云端设置的默认频道,但仍将尊重云端设置中的覆盖项。 | false | 5.4.0 |
defaultChannel | string | 设置应用程序在配置中的 ID。 | undefined | 5.5.0 |
appId | string | 配置插件以在重新加载后保留 URL 路径。警告:当触发重新加载时,‘window.history’ 将被清除。 | undefined | 6.0.0 |
keepUrlPathAfterReload | boolean | 配置__CAPGO_KEEP_0__以使用本地服务器进行测试。 | 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()
Section titled “notifyAppReady()”notifyAppReady() => Promise<AppReadyResult>通知Capacitor更新器当前包正在运行(如果不在每次应用启动时调用此方法,则会发生回滚) 默认情况下,此方法应在应用启动后第 10 秒内调用,否则会发生回滚。 可以通过 {@link appReadyTimeout} 来更改此行为
返回: Promise<AppReadyResult>
setUpdateUrl(…)
Section titled “setUpdateUrl(…)”setUpdateUrl(options: UpdateUrl) => Promise<void>设置应用更新 URL,这将用于检查更新。
| 参数 | 类型 | 描述 |
|---|---|---|
options | UpdateUrl | contains the URL to use for checking for updates。 |
Since: 5.4.0
setStatsUrl(…)
setStatsUrl(…)标题setStatsUrl(options: StatsUrl) => Promise<void>设置应用程序的statsUrl,用于发送统计数据。传入空字符串将禁用统计数据收集。
| 参数 | 类型 | 描述 |
|---|---|---|
options | StatsUrl | contains the URL to use for sending statistics。 |
Since: 5.4.0
setChannelUrl(…)
Section titled “setChannelUrl(…)”setChannelUrl(options: ChannelUrl) => Promise<void>为应用设置channelUrl,这将用于设置频道。
| 参数 | 类型 | 描述 |
|---|---|---|
options | ChannelUrl | 包含用于设置频道的URL。 |
自: 5.4.0
download(…)
Section titled “download(…)”download(options: DownloadOptions) => Promise<BundleInfo>从提供的URL下载一个新的包,应该是一个zip文件,包含文件或一个唯一id的文件夹,包含所有文件
| 参数 | 类型 | 描述 |
|---|---|---|
options | DownloadOptions | 参见 下载选项下载新包时的选项 |
返回值 Promise<BundleInfo>
下一步(…)
下一步(…)next(options: BundleId) => Promise<BundleInfo>设置下次重载应用时使用的包
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 包含下一次应用启动时设置的下一个捆绑包的ID。 {@link 捆绑包信息.id} |
返回值 Promise<BundleInfo>
set(…)
设置当前捆绑包并立即重新加载应用。set(options: BundleId) => Promise<void>类型
| 描述 | 复制到剪贴板 | 设置当前捆绑包并立即重新加载应用。 |
|---|---|---|
options | BundleId | A {@link BundleId}对象包含要设置为当前的新捆绑ID。 |
delete(…)
标题:delete(…)delete(options: BundleId) => Promise<void>从原生应用存储中删除指定捆绑包。使用 {@link list} 来获取存储的捆绑ID。
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | A {@link BundleId} 包含要删除的捆绑包 ID(注意,这是捆绑包 ID,而不是版本名称) |
list(…)
标题:list(…)list(options?: ListOptions | undefined) => Promise<BundleListResult>获取本地下载的所有捆绑包
| 参数 | 类型 | 描述 |
|---|---|---|
options | ListOptions | 用于列出捆绑包的 {@link ListOptions} |
返回值: Promise<BundleListResult>
reset(…)
标题:reset(…)reset(options?: ResetOptions | undefined) => Promise<void>重置应用到 builtin 应用包(苹果应用商店/谷歌应用商店)或最后一次成功加载的包。
| 参数 | 类型 | 描述 |
|---|---|---|
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 延迟条件} 数组,包含 Plugin 将使用的条件来延迟更新。
当所有条件都满足后,更新过程将重新启动,更新将在后台或杀死应用后安装。
对于 date kind,值应为 iso8601 日期字符串。
对于 background kind,值应为毫秒数。
对于 nativeVersion kind,值应为版本号。
对于 kill kind,值不被使用。
该函数在 kill 选项下存在不一致的行为,kill 选项会触发更新,但不是在下一次后台运行时,而是第一次杀死应用时。这将在未来的重大版本中得到修复。
| 参数 | 类型 | 描述 |
|---|---|---|
options | MultiDelayConditions | 包含 {@link 多重延迟条件} array of conditions to set |
自从: 4.3.0
取消延迟()
标题:取消延迟()cancelDelay() => Promise<void>取消一个 {@link 延迟条件} 立即处理更新。
自从: 4.0.0
getLatest(…)
标题:getLatest(…)getLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>从更新 URL 获取最新的捆绑包
| 参数 | 类型 |
|---|---|
options | GetLatestOptions |
返回: Promise<LatestVersion>
自: 4.0.0
setChannel(…)
标题:setChannel(…)setChannel(options: SetChannelOptions) => Promise<ChannelRes>设置此设备的插件管理的本地频道。频道必须 allow_device_self_set 启用才能正常工作。
setChannel() 验证频道与后端, 然后在设备上存储所选频道。它不会创建或更新后端设备的覆盖,因此设备不会在Capgo控制台中显示为被覆盖。只有从控制台或公共API创建的 assignments 才会在设备覆盖 UI 中显示。
注意事项:
- 不要在启动时使用此方法设置通道。请在
defaultChannelin your Capacitor config instead. - 此方法旨在在应用程序准备好并用户已交互(例如,选择参加beta测试)后使用。
- 公共通道无法自行分配。 如果一个通道被标记为
public,调用setChannel()会返回错误。要使用公共通道,请调用unsetChannel(),设备将自动切换到匹配的公共通道。 - 使用
listChannels()来发现哪些通道可用并是否允许自行分配。
| 参数 | 类型 | 描述 |
|---|---|---|
options | SetChannelOptions | 是否设置 {@link 设置通道选项} 通道 |
返回: Promise<ChannelRes>
自: 4.7.0
unsetChannel(…)
标题:unsetChannel(…)unsetChannel(options: UnsetChannelOptions) => Promise<void>清除本地设备的插件管理的通道。该操作仅清除本地存储的通道,不删除云端的设备配置。 setChannel()API
在调用此方法后,正常通道顺序适用:如果存在 Dashboard 或 Public API 设备覆盖,则优先级最高;否则,设备可以回退到匹配的公共/默认通道(基于平台、设备类型、构建类型)。
此功能在以下情况下有用:
- 您想将设备恢复到默认更新轨道
- 您想使用公共通道(由于公共通道无法自行分配
setChannel())
| 参数 | 类型 |
|---|---|
options | UnsetChannelOptions |
自: 4.7.0
getChannel()
标题:getChannel()getChannel() => Promise<GetChannelRes>获取此设备的通道
返回: Promise<GetChannelRes>
自从: 4.8.0
listChannels()
listChannels()listChannels() => Promise<ListChannelsResult>列出此设备可用的所有频道。返回与设备当前环境(平台、模拟器/真实设备、开发/生产构建)兼容的频道,并且是公共频道或允许自我分配。
每个频道结果中包括:
public如果true,这是一个 默认频道。您无法使用setChannel()将其分配给自己。相反,如果您使用unsetChannel()删除您的频道分配,设备将自动从公共频道接收更新。allow_self_set: 如果true, 这是一个 自赋予的频道。您可以使用setChannel().
返回: Promise<ListChannelsResult>
自从: 7.5.0
setCustomId(…)
标题:setCustomId(…)setCustomId(options: SetCustomIdOptions) => Promise<void>为此设备设置一个自定义 ID
| 参数 | 类型 | 描述 |
|---|---|---|
options | SetCustomIdOptions | 是 {@link SetCustomIdOptions} 中的自定义 ID |
自 4.9.0
getBuiltinVersion()
标题:getBuiltinVersion()getBuiltinVersion() => Promise<BuiltinVersion>获取本机应用程序版本或配置中设置的内置版本
返回: Promise<BuiltinVersion>
自 5.2.0
getDeviceId()
Section titled “getDeviceId()”getDeviceId() => Promise<DeviceId>获取用于识别设备的唯一 ID(发送到自动更新服务器)
返回: Promise<DeviceId>
getPluginVersion()
Section titled “getPluginVersion()”getPluginVersion() => Promise<PluginVersion>获取本地 Capacitor Updater 插件版本(发送到自动更新服务器)
返回: Promise<PluginVersion>
isAutoUpdateEnabled()
Section titled “isAutoUpdateEnabled()”isAutoUpdateEnabled() => Promise<AutoUpdateEnabled>获取自动更新配置状态。
返回值: Promise<AutoUpdateEnabled>
removeAllListeners()
标题:removeAllListeners()removeAllListeners() => Promise<void>移除此插件所有监听器。
Since: 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
添加监听器(‘更新可用’,…)
添加监听器(‘updateAvailable’,…)”addListener(eventName: 'updateAvailable', listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle>监听可用更新事件,适用于每次启动应用时强制检查
| 参数 | 类型 |
|---|---|
eventName | ’updateAvailable’ |
listenerFunc | (state: UpdateAvailableEvent) => void |
返回: Promise<PluginListenerHandle>
自: 4.0.0
添加监听器(‘downloadComplete’,…)
复制到剪贴板addListener(eventName: 'downloadComplete', listenerFunc: (state: DownloadCompleteEvent) => void) => Promise<PluginListenerHandle>参数
| 类型 | 类型 |
|---|---|
eventName | ’downloadComplete’ |
listenerFunc | (state: DownloadCompleteEvent) => void |
返回: Promise<PluginListenerHandle>
自: 4.0.0
添加监听器(‘majorAvailable’,…)
标题:添加监听器(‘majorAvailable’,…)addListener(eventName: 'majorAvailable', listenerFunc: (state: MajorAvailableEvent) => void) => Promise<PluginListenerHandle>在 App 中监听重大更新事件,让你知道重大更新是否被禁用
| 参数 | 类型 |
|---|---|
eventName | ’majorAvailable’ |
listenerFunc | (state: MajorAvailableEvent) => void |
返回: Promise<PluginListenerHandle>
自: 2.3.0
添加监听器(‘updateFailed’,…)
Section titled “addListener(‘updateFailed’, …)”addListener(eventName: 'updateFailed', listenerFunc: (state: UpdateFailedEvent) => void) => Promise<PluginListenerHandle>在 App 中监听更新失败事件,下次 App 启动时提示更新安装失败
| Param | Type |
|---|---|
eventName | ’updateFailed’ |
listenerFunc | (state: UpdateFailedEvent) => void |
Returns: Promise<PluginListenerHandle>
Since: 2.3.0
addListener(‘downloadFailed’, …)
Section titled “addListener(‘downloadFailed’, …)”addListener(eventName: 'downloadFailed', listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle>在 App 中监听下载失败事件,提示下载包下载失败
| Param | 类型 |
|---|---|
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 已经准备好使用
| 参数 | 类型 |
|---|---|
eventName | ’appReady’ |
listenerFunc | (state: AppReadyEvent) => void |
返回值: Promise<PluginListenerHandle>
自: 5.1.0
isAutoUpdateAvailable()
Section titled “isAutoUpdateAvailable()”isAutoUpdateAvailable() => Promise<AutoUpdateAvailable>获取是否有可用的自动更新(不受 serverUrl 禁用的影响)
返回值: Promise<AutoUpdateAvailable>
getNextBundle()
getNextBundle()getNextBundle() => Promise<BundleInfo | null>当应用程序重新加载时,将使用的下一个捆绑包。 如果没有设置下一个捆绑包,则返回 null。
返回值: Promise<BundleInfo | null>
自: 6.8.0
setShakeMenu(…)
Section titled “setShakeMenu(…)”setShakeMenu(options: SetShakeMenuOptions) => Promise<void>用于调试/测试目的,启用或禁用抖动菜单
| 参数 | 类型 | 简介 |
|---|---|---|
options | SetShakeMenuOptions | 包含一个布尔值来启用或禁用抖动菜单 |
自: 7.5.0
isShakeMenuEnabled()
标题:isShakeMenuEnabled()isShakeMenuEnabled() => Promise<ShakeMenuEnabled>获取抖动菜单的当前状态
返回: Promise<ShakeMenuEnabled>
自: 7.5.0
接口
标题:接口应用程序就绪结果
AppReadyResult| AppReadyResult | 属性 |
|---|---|
bundle | BundleInfo |
| BundleInfo | 属性 |
|---|---|
id | string |
version | string |
downloaded | string |
checksum | string |
status | BundleStatus |
类型
更新地址| 更新地址 | 属性 |
|---|---|
url | string |
类型
StatsUrl| 属性 | 类型 |
|---|---|
url | string |
频道URL
频道URL| 属性 | 类型 |
|---|---|
url | string |
下载选项
下载选项此 URL 和版本用于从服务器下载捆绑包。如果您使用后端,则所有信息都将由方法 getLatest 提供。如果您不使用后端,则需要提供捆绑包的 URL 和版本。若捆绑包已使用 CLI 命令加密,则需要 SessionKey,应从加密命令的结果中接收。
| 属性 | 类型 | 描述 | 默认 | 自 |
|---|---|---|---|---|
url | string | 下载的捆绑 zip 文件 (例如: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 |
BundleId
BundleId| 属性 | 类型 |
|---|---|
id | string |
BundleListResult
BundleListResult| 属性 | 类型 |
|---|---|
bundles | BundleInfo[] |
ListOptions
ListOptions| 属性 | 类型 | 描述 | 默认 | 自 |
|---|---|---|---|---|
raw | boolean | 是否返回原始包列表或清单。如果为真,列表将尝试读取内部数据库而不是磁盘上的文件。 | false | 6.14.0 |
重置选项
标题:重置选项| 属性 | 类型 |
|---|---|
toLastSuccessful | boolean |
当前包结果
标题:当前包结果| 属性 | 类型 |
|---|---|
bundle | BundleInfo |
native | string |
多延迟条件
多延迟条件| 属性 | 类型 |
|---|---|
delayConditions | DelayCondition[] |
延迟条件
延迟条件| 属性 | 类型 | 描述 |
|---|---|---|
kind | DelayUntilNext | 设置延迟条件在 setMultiDelay |
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 | 获取最新版本的频道 | undefined | 6.8.0 |
频道必须允许 ‘自行分配’ 才能正常工作
频道资源| 频道资源 | 属性 | 类型 | 描述 |
|---|---|---|---|
status | string | 自 | 4.7.0 |
error | string | ||
message | string |
设置频道选项
设置频道选项| 属性 | 类型 |
|---|---|
channel | string |
triggerAutoUpdate | boolean |
UnsetChannelOptions
标题:UnsetChannelOptions| 属性 | 类型 |
|---|---|
triggerAutoUpdate | boolean |
获取频道
标题:获取频道| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
channel | string | 获取频道当前状态 | 4.8.0 |
error | string | ||
message | string | ||
status | string | ||
allowSet | boolean |
获取频道结果
ListChannelsResult| __CAPGO_KEEP_0__ | __CAPGO_KEEP_1__ | __CAPGO_KEEP_2__ | __CAPGO_KEEP_3__ |
|---|---|---|---|
channels | ChannelInfo[] | __CAPGO_KEEP_4__ | 7.5.0 |
__CAPGO_KEEP_5__
__CAPGO_KEEP_6__| __CAPGO_KEEP_7__ | __CAPGO_KEEP_8__ | ChannelInfo | __CAPGO_KEEP_9__ |
|---|---|---|---|
id | number | The numeric channel ID | 7.5.0 |
name | string | The channel name | 7.5.0 |
public | boolean | 如果为 true,则这是一个默认/备用频道。设备无法自行将其分配到公共频道。相反,当设备使用()移除其频道覆盖时,它将自动从匹配的公共频道接收更新。 unsetChannel()如果为 true,设备可以使用()显式将其分配到此频道。通常用于 beta 测试、A/B 测试或优惠升级跟踪。 | 7.5.0 |
allow_self_set | boolean | 频道命令使用频道 setChannel(),而不是这个数字 | 7.5.0 |
SetCustomIdOptions name标题:SetCustomIdOptions id.
属性
类型| __CAPGO_KEEP_0__ | __CAPGO_KEEP_1__ |
|---|---|
customId | string |
__CAPGO_KEEP_0__
内置版本| __CAPGO_KEEP_1__ | __CAPGO_KEEP_2__ |
|---|---|
version | string |
__CAPGO_KEEP_3__
设备ID| __CAPGO_KEEP_1__ | __CAPGO_KEEP_2__ |
|---|---|
deviceId | string |
__CAPGO_KEEP_4__
__CAPGO_KEEP_5__| __CAPGO_KEEP_1__ | __CAPGO_KEEP_2__ |
|---|---|
version | string |
自动更新
自动更新| 属性 | 类型 |
|---|---|
enabled | boolean |
插件监听器句柄
属性| 类型 | 下载事件 |
|---|---|
remove | () => Promise<void> |
属性
类型| 下载事件 | 属性 | 描述 | 自从 |
|---|---|---|---|
percent | number | 下载当前状态,范围为 0 到 100。 | 4.0.0 |
bundle | BundleInfo |
无需事件
标题:无需事件| 属性 | 类型 | 描述 | 自从 |
|---|---|---|---|
bundle | BundleInfo | 下载当前状态,范围为 0 到 100。 | 4.0.0 |
可更新事件
标题:可更新事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 下载进度,范围为 0 到 100。 | 4.0.0 |
下载完成事件
下载完成事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 当有新更新可用时触发 | 4.0.0 |
主要可用事件
标题:主要可用事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | 当有新的主要捆绑包可用时触发。 | 4.0.0 |
更新失败事件
标题:更新失败事件| 属性 | 类型 | 描述 | 自从 |
|---|---|---|---|
bundle | BundleInfo | __CAPGO_KEEP_0__ | 4.0.0 |
下载失败事件
下载失败事件| 属性 | 类型 | 描述 | 自从 |
|---|---|---|---|
version | string | __CAPGO_KEEP_0__ | 4.0.0 |
应用程序就绪事件
属性| 下载失败事件 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 应用程序准备好使用时发出。 | 5.2.0 |
status | string |
自动更新可用
标题:自动更新可用| 属性 | 类型 |
|---|---|
available | boolean |
设置摇动菜单选项
标题:设置摇动菜单选项| 属性 | 类型 |
|---|---|
enabled | boolean |
ShakeMenuEnabled
Section titled “ShakeMenuEnabled”| 属性 | 类型 |
|---|---|
enabled | boolean |
类型别名
类型别名BundleStatus
Section titled “BundleStatus”pending: The bundle is pending to be 等待:正在等待下一个包的下载 设置 正在下载:正在下载包中 成功:包下载完成,准备好使用 作为下一个捆绑包。
‘success’ | ‘error’ | ‘pending’ | ‘downloading’
错误:捆绑包下载失败。
延迟到下一个‘background’ | ‘kill’ | ‘nativeVersion’ | ‘date’
标题:延迟到下一个
从功能和设置继续标题:从功能和设置继续 如果您正在使用 to plan dashboard and API operations, connect it with Using @capgo/capacitor-updater 使用@capgo/capacitor-updater API Overview 使用@API/__CAPGO_KEEP_1__-updater, 简介 简介中的实现细节 API 键 API 键中的实现细节 设备 设备中的实现细节