功能和设置
复制一个包含安装步骤和此插件的完整 Markdown 指南的设置提示。
更新器插件配置
名为“更新器插件配置”的部分查看 Github README 了解更多信息。
CapacitorUpdater 可以使用以下选项进行配置:
| 属性 | 类型 | 描述 | 默认值 | 自 |
|---|---|---|---|---|
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’ | 配置插件如何通过更新服务器使用自动更新。true 与“atBackground”相同,false 与“off”相同。- off:禁用自动更新- atBackground:在应用程序移动到后台时自动检查和下载,然后在应用程序移动到后台时应用- atInstall:仅在新安装或原生应用程序更新后立即应用,否则使用 atBackground- onLaunch:在启动时立即应用,否则在启动检查后使用 atBackground- always:在自动更新运行时立即应用- onlyDownload:自动检查和下载,然后在应用程序移动到后台时应用。可用于 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 | 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’ | Deprecated. Use autoUpdate string modes instead: “atInstall”,“onLaunch”,或“always”。 This option remains supported for existing apps. - false: Never do direct updates - atInstall: Same as autoUpdate: “atInstall” - onLaunch: Same as autoUpdate: “onLaunch” - always: Same as autoUpdate: “always” - true: Same as “always” for backward compatibility. Available on Android, iOS, and Electron. | false | 5.1.0 |
autoSplashscreen | boolean | 自动隐藏启动屏幕,当使用即时应用模式时会自动处理。当启用时,插件将在更新应用程序或无需更新时自动隐藏启动屏幕。这消除了手动监听appReady事件并调用SplashScreen.hide()的需要。仅在autoUpdate设置为“atInstall”,“onLaunch”或“always”时才有效。为了保持向后兼容,仍支持Legacy直接更新值。需要安装并配置@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使用本地服务器进行测试。 | 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日志的插件。如果为真,插件将不会在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()- 接口
- Type Aliases
Methods
方法列表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
setStatsUrl(…)
标题:setStatsUrl(…)setStatsUrl(options: StatsUrl) => Promise<void>设置应用程序的 statsUrl,用于发送统计数据。传入空字符串将禁用统计数据收集。
| 参数 | 类型 | 描述 |
|---|---|---|
options | StatsUrl | contains the URL to use for sending statistics。 |
Since: 5.4.0
setChannelUrl(…)
setChannelUrl(…)setChannelUrl(options: ChannelUrl) => Promise<void>设置应用的channelUrl,用于设置channel。
| Param | Type | Description |
|---|---|---|
options | ChannelUrl | contains the URL to use for setting the channel。 |
Since: 5.4.0
download(…)
下载(…)download(options: DownloadOptions) => Promise<BundleInfo>从提供的 URL 下载一个新的压缩包,应该是一个 zip 文件,包含所有文件或一个唯一 id 内的所有文件
| 参数 | 类型 | 描述 |
|---|---|---|
options | DownloadOptions | 用于下载新压缩包 zip 的 {@link DownloadOptions} |
返回: Promise<BundleInfo>
next(…)
下一步next(options: BundleId) => Promise<BundleInfo>在应用程序重新加载时使用的下一个捆绑包设置为
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 包含应用程序下一次启动时设置的下一个捆绑包的ID。 {@link BundleInfo.id} |
返回值 Promise<BundleInfo>
set(…)
标题:set(…)set(options: BundleId) => Promise<void>设置当前捆绑包并立即重新加载应用程序.
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | A {@link BundleId}对象,包含要设置为当前的新包ID。 |
delete(…)
标题:delete(…)delete(options: BundleId) => Promise<void>从原生应用存储中删除指定包。使用 {@link list} 来获取存储的 Bundle IDs。
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 一个 {@link} 对象,包含要删除的捆绑包的 ID(注意,这是捆绑包 ID,而不是版本名称) BundleIdlist(…) |
名为“list(…)
复制到剪贴板list(options?: ListOptions | undefined) => Promise<BundleListResult>Param
| Type | 描述 | 一个 {@link} |
|---|---|---|
options | ListOptions | Get all locally downloaded bundles in your app 列表选项}用于列出捆绑包 |
返回值: Promise<BundleListResult>
reset(…)
标题:reset(…)reset(options?: ResetOptions | undefined) => Promise<void>重置应用到 builtin 捆绑包(苹果应用商店/谷歌商店发送的那个)或最后成功加载的捆绑包。
| 参数 | 类型 | 描述 |
|---|---|---|
options | ResetOptions | 包含{@link} ResetOptions.toLastSuccessful}, true 重置为内置的捆绑包并 false 将重置为最后一次成功加载的捆绑包。 |
current()
标题:current()current() => Promise<CurrentBundleResult>获取当前捆绑包,如果没有设置则返回 builtin. currentNative 是设备上安装的原始捆绑包
返回: Promise<CurrentBundleResult>
reload()
标题:reload()reload() => Promise<void>重新加载视图
__CAPGO_KEEP_0__
标题:__CAPGO_KEEP_0__setMultiDelay(options: MultiDelayConditions) => Promise<void>设置一个延迟条件数组,包含插件将使用的条件来延迟更新。
当所有条件都满足后,更新过程将重新启动,更新将在后台或杀死应用后安装。
对于"kind",值应为ISO8601日期字符串。
对于"kind",值应为毫秒数。
对于"kind",值应为版本号。
对于"kind",值不被使用。
该函数在选项"kill"时存在不一致的行为,杀死应用后会触发更新,而不是在下一次后台运行。
将在未来的重大版本中修复。 Param__CAPGO_KEEP_0__ date __CAPGO_KEEP_0__ background __CAPGO_KEEP_0__ nativeVersion __CAPGO_KEEP_0__ kill __CAPGO_KEEP_0__
| __CAPGO_KEEP_0__ | 类型 | 描述 |
|---|---|---|
options | MultiDelayConditions | 包含 {@link 多延迟条件} 数组的条件以设置 |
自 4.3.0
cancelDelay()
标题为“cancelDelay()”的部分cancelDelay() => Promise<void>取消 {@link 延迟条件} 以立即处理更新。
自: 4.0.0
getLatest(…)
getLatest(…)标题getLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>获取最新的可用更新包
| 参数 | 类型 |
|---|---|
options | GetLatestOptions |
返回: Promise<LatestVersion>
自: 4.0.0
setChannel(…)
setChannel(…)标题setChannel(options: SetChannelOptions) => Promise<ChannelRes>设置此设备的插件管理的本地频道。频道必须 allow_device_self_set 必须启用才能正常工作。
setChannel() 验证频道与后端, 然后在设备上存储所选频道。它不会创建或更新后端设备覆盖,因此设备不会在Capgo控制台中显示为覆盖。只有从控制台或公共API创建的 assignments 才会在设备覆盖 UI 中显示。
重要注意事项:
- 不要使用此方法在启动时设置频道。使用
defaultChannel在你的Capacitor配置中。 - 此方法旨在在应用程序准备好并用户已交互(例如,选择参加beta测试)后使用。
- 公共频道不能自行分配。 如果频道标记为
public, 调用setChannel()会返回错误。要使用公共频道,请调用unsetChannel()- 设备将自动切换到匹配的公共频道。 - 使用
listChannels()以发现哪些频道可用并且是否允许自我赋值。
| 参数 | 类型 | 描述 |
|---|---|---|
options | SetChannelOptions | 是否设置 {@link SetChannelOptions} 频道 |
返回: Promise<ChannelRes>
自: 4.7.0
unsetChannel(…)
标题:unsetChannel(…)unsetChannel(options: UnsetChannelOptions) => Promise<void>清除此设备上的插件管理的本地通道。该操作仅清除本地存储的通道,不删除仪表盘或公共__CAPGO_KEEP_0__设备覆盖记录。 setChannel()此方法调用后,正常通道顺序生效:如果存在仪表盘或公共API设备覆盖记录,则优先使用;否则设备可以回落到匹配公共/默认通道(根据平台、设备类型、构建类型)。
After calling this method, normal channel precedence applies: an existing Dashboard or Public API Device Override still wins; otherwise the device can fall back to the matching public/default channel for its conditions (platform, device type, build type).
您想将设备移回默认更新轨道
- 您想使用公共通道(由于公共通道无法自行分配至__CAPGO_KEEP_0__设备覆盖记录)
- Param
setChannel())
| Type | Since: |
|---|---|
options | UnsetChannelOptions |
getChannel() 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>获取本机应用程序版本或配置文件中设置的内置版本
Returns: Promise<BuiltinVersion>
Since: 5.2.0
getDeviceId()
Section titled “getDeviceId()”getDeviceId() => Promise<DeviceId>获取设备唯一标识(用于自动更新服务器)
Returns: Promise<DeviceId>
getPluginVersion()
Section titled “getPluginVersion()”getPluginVersion() => Promise<PluginVersion>获取本地Capacitor Updater 插件版本(用于自动更新服务器)
Returns: Promise<PluginVersion>
isAutoUpdateEnabled()
isAutoUpdateEnabled()方法isAutoUpdateEnabled() => Promise<AutoUpdateEnabled>获取自动更新配置状态
返回值: Promise<AutoUpdateEnabled>
removeAllListeners()
isAutoUpdateEnabled()方法removeAllListeners() => Promise<void>移除所有此插件的监听器
自 1.0.0
addListener('download', …)
isAutoUpdateEnabled()方法addListener(eventName: 'download', listenerFunc: (state: DownloadEvent) => void) => Promise<PluginListenerHandle>在 App 中监听包下载事件。触发一次下载开始、下载中和下载完成。
| 参数 | 类型 |
|---|---|
eventName | ’download’ |
listenerFunc | (state: DownloadEvent) => void |
返回值: Promise<PluginListenerHandle>
自: 2.0.11
添加监听器(‘无需更新’,…)
复制到剪贴板addListener(eventName: 'noNeedUpdate', listenerFunc: (state: NoNeedEvent) => void) => Promise<PluginListenerHandle>参数
| 类型 | addListener(‘noNeedUpdate’,…) |
|---|---|
eventName | ’noNeedUpdate’ |
listenerFunc | (state: NoNeedEvent) => void |
Returns: Promise<PluginListenerHandle>
自从: 4.0.0
addListener(‘updateAvailable’, …)
更新可用事件监听addListener(eventName: 'updateAvailable', listenerFunc: (state: UpdateAvailableEvent) => void) => Promise<PluginListenerHandle>每次启动应用时强制检查更新,非常有用
| 参数 | 类型 |
|---|---|
eventName | ’updateAvailable’ |
listenerFunc | (state: UpdateAvailableEvent) => void |
Returns: Promise<PluginListenerHandle>
自从: 4.0.0
addListener(‘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 中监听 Major 更新事件,通知您当 Major 更新被禁用时会被阻止,通过设置 disableAutoUpdateBreaking
| 参数 | 类型 |
|---|---|
eventName | ’majorAvailable’ |
listenerFunc | (state: MajorAvailableEvent) => void |
Returns: Promise<PluginListenerHandle>
自从: 2.3.0
addListener(‘updateFailed’, …)
标题:添加监听器(‘updateFailed’,…)addListener(eventName: 'updateFailed', listenerFunc: (state: UpdateFailedEvent) => void) => Promise<PluginListenerHandle>在 App 中监听更新失败事件,通知您下次启动应用时更新安装失败
| 参数 | 类型 |
|---|---|
eventName | ’updateFailed’ |
listenerFunc | (state: UpdateFailedEvent) => void |
Returns: Promise<PluginListenerHandle>
自从: 2.3.0
addListener(‘downloadFailed’, …)
标题:添加监听器(‘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 |
Returns: Promise<PluginListenerHandle>
自 4.3.0
addListener(‘appReady’, …)
标题:监听应用就绪事件addListener(eventName: 'appReady', listenerFunc: (state: AppReadyEvent) => void) => Promise<PluginListenerHandle>监听应用就绪事件,让您知道应用何时准备就绪
| 参数 | 类型 |
|---|---|
eventName | ’appReady’ |
listenerFunc | (state: AppReadyEvent) => void |
Returns: Promise<PluginListenerHandle>
自 5.1.0
isAutoUpdateAvailable()
标题:检查是否有可用的更新isAutoUpdateAvailable() => Promise<AutoUpdateAvailable>获取是否有可用的自动更新(不受serverUrl禁用)。
返回值: Promise<AutoUpdateAvailable>
getNextBundle()
标题:getNextBundle()getNextBundle() => Promise<BundleInfo | null>获取将在应用程序重新加载时使用的下一个捆绑包。 如果没有设置下一个捆绑包,则返回 null。
返回值: Promise<BundleInfo | null>
自: 6.8.0
setShakeMenu(…)
标题:setShakeMenu(…)setShakeMenu(options: SetShakeMenuOptions) => Promise<void>Enable or disable the shake menu for debugging/testing purposes
| Param | Type | Description |
|---|---|---|
options | SetShakeMenuOptions | Contains enabled boolean to enable or disable shake menu |
Since: 7.5.0
isShakeMenuEnabled()
Section titled “isShakeMenuEnabled()”isShakeMenuEnabled() => Promise<ShakeMenuEnabled>Get the current state of the shake menu
Returns: Promise<ShakeMenuEnabled>
Since: 7.5.0
AppReadyResult
名为“AppReadyResult”的部分| 属性 | 类型 |
|---|---|
bundle | BundleInfo |
BundleInfo
名为“BundleInfo”的部分| 属性 | 类型 |
|---|---|
id | string |
version | string |
downloaded | string |
checksum | string |
status | BundleStatus |
更新地址
名为“更新地址”的部分| 属性 | 类型 |
|---|---|
url | string |
统计URL
统计URL| 属性 | 类型 |
|---|---|
url | string |
频道URL
频道URL| 属性 | 类型 |
|---|---|
url | string |
下载选项
下载选项此 URL 和版本用于从服务器下载捆绑包。如果您使用后端,则所有信息都将通过方法 getLatest 提供。如果您不使用后端,则需要提供捆绑包的 URL 和版本。若捆绑包使用 CLI 命令加密,则需要 SessionKey,应从加密命令的结果中接收。
| 属性 | 类型 | 描述 | 默认值 | 自 |
|---|---|---|---|---|
url | string | 捆绑包 zip 文件的 URL (例如:dist.zip),用于下载。 (此 URL 可以是任何 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 |
清单条目
ManifestEntry| 属性 | 类型 |
|---|---|
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 |
ResetOptions
属性| 类型 | 当前包结果 |
|---|---|
toLastSuccessful | boolean |
Prop
当前Bundle结果| 属性 | 类型 |
|---|---|
bundle | BundleInfo |
native | string |
多延迟条件
多延迟条件| 属性 | 类型 |
|---|---|
delayConditions | DelayCondition[] |
延迟条件
属性| 类型 | 描述 | __CAPGO_KEEP_0__ |
|---|---|---|
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 |
获取最新选项
获取最新选项| 属性 | 类型 | 描述 | 默认 | 自 |
|---|---|---|---|---|
channel | string | 为了获取最新版本的频道,必须允许 ‘自_assign’ | undefined | 6.8.0 |
ChannelRes
频道Res| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
status | string | 设置频道的当前状态 | 4.7.0 |
error | string | ||
message | string |
SetChannelOptions
设置频道选项| 属性 | 类型 |
|---|---|
channel | string |
triggerAutoUpdate | boolean |
清除频道选项
清除频道选项| 属性 | 类型 |
|---|---|
triggerAutoUpdate | boolean |
获取频道结果
获取频道结果| 属性 | 类型 | 描述 | 自从 |
|---|---|---|---|
channel | string | 获取频道的当前状态 | 4.8.0 |
error | string | ||
message | string | ||
status | string | ||
allowSet | boolean |
ListChannelsResult
频道列表结果| Prop | Type | 描述 | 自从 |
|---|---|---|---|
channels | ChannelInfo[] | 可用的频道列表 | 7.5.0 |
ChannelInfo
频道信息| Prop | 类型 | 描述 | 自 |
|---|---|---|---|
id | number | 数字通道ID | 7.5.0 |
name | string | 通道名称 | 7.5.0 |
public | boolean | 如果为真,这是默认/备份通道。设备无法自行将其分配到公共通道。相反,当设备使用()移除其通道覆盖时,它将自动从匹配的公共通道接收更新。 unsetChannel()如果为真,设备可以使用()显式将其分配到此通道。通常用于beta测试、A/B测试或优先更新跟踪。 | 7.5.0 |
allow_self_set | boolean | 通道命令使用通道 setChannel(),而不是数字 | 7.5.0 |
设置自定义ID选项 name__CAPGO_KEEP_0__ id.
__CAPGO_KEEP_0__
设置自定义ID选项| 属性 | 类型 |
|---|---|
customId | string |
内置版本
设置内置版本| 属性 | 类型 |
|---|---|
version | string |
设备ID
属性| 类型 | 插件版本 |
|---|---|
deviceId | string |
属性
插件版本| 属性 | 类型 |
|---|---|
version | string |
自动更新
自动更新| 属性 | 类型 |
|---|---|
enabled | boolean |
插件监听器句柄
属性| 类型 | 下载事件 |
|---|---|
remove | () => Promise<void> |
__CAPGO_KEEP_0__
下载事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
percent | number | 下载进度,范围为 0 到 100。 | 4.0.0 |
bundle | BundleInfo |
无需事件
属性| 类型 | 描述 | 自 | __CAPGO_KEEP_0__ |
|---|---|---|---|
bundle | BundleInfo | 下载进度,范围为0到100。 | 4.0.0 |
UpdateAvailableEvent
更新可用事件| Section titled “UpdateAvailableEvent” | 属性 | 类型 | 描述 |
|---|---|---|---|
bundle | BundleInfo | 自 | 4.0.0 |
下载进度,范围为0到100。
DownloadCompleteEvent| 下载完成事件 | Section titled “DownloadCompleteEvent” | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 当有新版本可用时触发。 | 4.0.0 |
MajorAvailableEvent
标题:MajorAvailableEvent| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | 当有新主要捆绑包可用时触发。 | 4.0.0 |
UpdateFailedEvent
标题:UpdateFailedEvent| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | __CAPGO_KEEP_0__ | 4.0.0 |
下载失败事件
下载失败事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | __CAPGO_KEEP_0__ | 4.0.0 |
AppReadyEvent
AppReadyEvent| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 应用程序准备好使用时发射。 | 5.2.0 |
status | string |
AutoUpdateAvailable
AutoUpdateAvailable| 属性 | 类型 |
|---|---|
available | boolean |
设置抖动菜单选项
SetShakeMenuOptions| 属性 | 类型 |
|---|---|
enabled | boolean |
ShakeMenuEnabled
ShakeMenuEnabled| 属性 | 类型 |
|---|---|
enabled | boolean |
类型别名
类型别名BundleStatus
BundleStatuspending: 等待打包 SET 正在下载:正在下载包。 SET 下载失败:下载包失败。
‘success’ | ‘error’ | ‘pending’ | ‘downloading’
延迟到下一次
延迟到下一次‘background’ | ‘kill’ | ‘nativeVersion’ | ‘date’
继续从功能和设置
继续从功能和设置如果您正在使用 功能和设置 来规划仪表板和API操作,连接它与 使用@capgo/capacitor-updater 为使用 @capgo/capacitor-updater 的原生能力 API 概述 为 API 概述 的实现细节 介绍 为介绍 的实现细节 API 密钥 为 API 密钥 的实现细节 设备 为设备 的实现细节