14 天的无限免费试用,不需要信用卡
复制一个包含安装步骤和此插件的完整 Markdown 指南的设置提示。
更新器插件配置
标题为“更新器插件配置”查看Github README 更多信息。
CapacitorUpdater 可以使用以下选项进行配置:
| 属性 | 类型 | Description | 描述 | 默认值 |
|---|---|---|---|---|
appReadyTimeout | number | 自 | 10000 // (10 seconds) | |
responseTimeout | number | 配置原生插件在等待API超时之前等待的毫秒数。可用于Android、iOS和Electron。 | 20000 // (20 seconds) | |
autoDeleteFailed | boolean | 配置native插件在考虑__CAPGO_KEEP_0__超时之前等待的毫秒数。可用于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:自动检查和下载,发出 updateAvailable,永远不会自动设置下一个捆绑包。 立即应用模式(“atInstall”,“onLaunch”,“always”)应上传 —delta 以避免更新延迟用户体验。 在 Android 和 iOS 上,需要设置 autoSplashscreen: true 和 @capacitor/splash-screen 以及 launchAutoHide: false。 可用于 Android、iOS 和 Electron。 | “atBackground” // true is still accepted | |
resetWhenUpdate | boolean | 自动删除设备上安装的新版本原生应用程序捆绑包时下载的以前捆绑包。 可用于 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 | 配置终端到终端live update加密的公钥。版本 2。可用于 Android、iOS 和 Electron。 | undefined | 6.2.0 |
version | string | 配置应用程序的当前版本。该版本将用于第一次更新请求。如果未设置,插件将从原生code获取版本。可用于 Android、iOS 和 Electron。 | undefined | 4.17.48 |
directUpdate | boolean | ‘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。 | false | 5.1.0 |
autoSplashscreen | boolean | 在使用“atInstall”,“onLaunch”或“always”模式(包括已弃用的直接更新值)时必需,包括 @capacitor/splash-screen 必须已安装并配置为 launchAutoHide:false。启用后,插件在应用程序更新后或无需更新时隐藏启动屏幕。从而避免手动监听 appReady 事件并调用 SplashScreen.hide()。可用于 Android 和 iOS。 | false | 7.6.0 |
periodCheckDelay | number | Configure the delay period for period update check. the unit is in seconds. Available on Android, iOS, and Electron. Cannot be less than 600 seconds (10 minutes). | 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>参数
| 类型 | 描述 | Description |
|---|---|---|
options | UpdateUrl | 用于检查更新的 URL。 |
自从: 5.4.0
setStatsUrl(…)
setStatsUrl(…)部分setStatsUrl(options: StatsUrl) => Promise<void>设置应用的统计 URL,用于发送统计数据。传入空字符串将禁用统计数据收集。
| 参数 | 类型 | Description |
|---|---|---|
options | StatsUrl | 描述 |
自从: 5.4.0
用于发送统计数据的 URL。
Section titled “设置频道URL(…)”setChannelUrl(options: ChannelUrl) => Promise<void>设置应用程序的频道URL,这将用于设置频道。
| 参数 | 类型 | 描述 |
|---|---|---|
options | ChannelUrl | 包含用于设置频道的URL。 |
自: 5.4.0
download(options: DownloadOptions) => Promise<BundleInfo>从提供的URL下载一个新的包,应该是一个zip文件,包含文件或一个唯一ID的文件夹,包含所有文件
| 参数 | 类型 | 关于Capgo页面 |
|---|---|---|
options | DownloadOptions | 描述 下载选项下载新包zip文件的选项 |
返回值 Promise<BundleInfo>
下一个(…)
下一个(…)next(options: BundleId) => Promise<BundleInfo>设置下一次重载应用时使用的包
| 参数 | 类型 | 描述 |
|---|---|---|
options | BundleId | 包含下一次应用启动时设置的下一个捆绑包的ID。 {@link} 捆绑包信息.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。
| Param | Type | 描述 |
|---|---|---|
options | BundleId | A {@link} BundleId{object containing the ID of a bundle to delete (note, this is the bundle id, NOT the version name)} |
list(…)
列表(…)list(options?: ListOptions | undefined) => Promise<BundleListResult>获取本地下载的所有包
| 参数 | 类型 | 关于Capgo页面 |
|---|---|---|
options | ListOptions | 描述 用于列出包的 {@link}ListOptions |
返回: Promise<BundleListResult>
reset(…)
reset(…)reset(options?: ResetOptions | undefined) => Promise<void>将应用程序重置为 builtin (向 Apple App Store / Google Play Store 发送的包或最后一次成功加载的包)。
| 参数 | 类型 | 描述 |
|---|---|---|
options | ResetOptions | 包含 {@link} ResetOptions.toLastSuccessful}, true 重置为内置包并 false 将重置为最后一次成功加载的包。 |
current()
current()current() => Promise<CurrentBundleResult>获取当前的包,如果没有设置则返回 builtincurrentNative是设备上安装的原始包
返回: Promise<CurrentBundleResult>
reload()
reload()reload() => Promise<void>重新加载视图
setMultiDelay(…)
setMultiDelay(…)setMultiDelay(options: MultiDelayConditions) => Promise<void>设置一个延迟条件数组 延迟条件} array containing conditions that the Plugin will use to delay the update.
After all conditions are met, the update process will run start again as usual, so update will be installed after a backgrounding or killing the app.
For the date 延迟条件 background kind,值应为以毫秒为单位的数字。
对于 nativeVersion 延迟条件 kill kind, the value is not used.
The function has inconsistent behavior the option kill do 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.
| 延迟条件 | Type | 延迟条件 |
|---|---|---|
options | MultiDelayConditions | 参数类型 多阶段条件设置多阶段条件的数组 |
自 4.3.0
取消延迟()
取消延迟()cancelDelay() => Promise<void>取消延迟条件 取消延迟条件获取最新(…)
自 4.0.0
获取最新(…)
获取最新版本(getLatest(…))getLatest(options?: GetLatestOptions | undefined) => Promise<LatestVersion>从更新 URL 获取最新的包
| 参数 | 类型 |
|---|---|
options | GetLatestOptions |
Returns: Promise<LatestVersion>
返回: 4.0.0
setChannel(options: SetChannelOptions) => Promise<ChannelRes>标题:setChannel(…) allow_device_self_set 设置此设备的插件管理的本地频道。频道必须
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.
注意事项:
- 请勿在启动时使用此方法设置频道。应在应用程序准备就绪并用户已交互(例如,选择 beta 版本)时使用。
defaultChannelin your Capacitor config instead. - 公共频道无法自行分配。
- 如果频道被标记为 ,调用
public将返回错误。要使用公共频道,请调用setChannel(),设备将自动切换到匹配的公共频道。unsetChannel()使用 - Use
listChannels()参数
| Param | 类型 | 描述 |
|---|---|---|
options | SetChannelOptions | 是设置 {@link 设置频道选项}频道 |
返回: Promise<ChannelRes>
自 4.7.0
unsetChannel(…)
标题:unsetChannel(…)unsetChannel(options: UnsetChannelOptions) => Promise<void>清除本地设备的插件管理的频道设置。仅清除本地存储的频道设置,不删除仪表盘或公共 __CAPGO_KEEP_0__ 设备覆盖记录。 setChannel(); 不会删除仪表板或公共API设备Override记录。
在调用此方法后,正常渠道顺序适用:已有的仪表板或公共API设备覆盖仍然有效;否则,设备可以回退到匹配公共/默认渠道的条件(平台、设备类型、构建类型)。
此功能有用在以下情况:
- 您想将设备移回默认更新轨道
- 您想使用公共渠道(由于公共渠道无法自行分配)
setChannel())
| 参数 | 类型 |
|---|---|
options | UnsetChannelOptions |
Since: 4.7.0
自从:
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() => Promise<BuiltinVersion>获取本机应用程序版本或在配置中设置的内置版本
返回: Promise<BuiltinVersion>
自 5.2.0
获取设备 ID()
获取设备 IDgetDeviceId() => Promise<DeviceId>获取设备唯一标识(用于自动更新服务器)
Returns: Promise<DeviceId>
getPluginVersion()
获取插件版本getPluginVersion() => Promise<PluginVersion>获取本地Capacitor Updater插件版本(用于自动更新服务器)
Returns: Promise<PluginVersion>
isAutoUpdateEnabled()
是否自动更新可用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>监听应用程序中bundle下载事件。下载开始时、下载中以及下载完成时触发一次。 此事件将返回下载百分比。
| 参数 | 类型 |
|---|---|
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 |
Returns: Promise<PluginListenerHandle>
返回: 4.0.0
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 中监听 Major 更新事件,让你知道当 Major 更新被禁用时会被阻止
| 参数 | 类型 |
|---|---|
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
添加监听器(‘downloadFailed’,…)”标题
在 App 中监听下载失败事件,让你知道某个 Bundle 下载失败addListener(eventName: 'downloadFailed', listenerFunc: (state: DownloadFailedEvent) => void) => Promise<PluginListenerHandle>Param
| 参数 | 类型 |
|---|---|
eventName | ‘downloadFailed’ |
listenerFunc | (state: DownloadFailedEvent) => void |
返回: Promise<PluginListenerHandle>
自: 4.0.0
添加监听器(‘appReloaded’,…)
添加监听器(‘appReloaded’,…)addListener(eventName: 'appReloaded', listenerFunc: () => void) => Promise<PluginListenerHandle>监听 App 重载事件,让你知道 App 已经重新加载
| 参数 | 类型 |
|---|---|
eventName | ‘appReloaded’ |
listenerFunc | () => void |
返回: Promise<PluginListenerHandle>
自: 4.3.0
添加监听器(‘appReady’,…)
标题:添加监听器(‘appReady’,…)”addListener(eventName: 'appReady', listenerFunc: (state: AppReadyEvent) => void) => Promise<PluginListenerHandle>在 App 中监听 app ready 事件,让你知道 app 已经准备好使用
| 参数 | 类型 |
|---|---|
eventName | ‘appReady’ |
listenerFunc | (state: AppReadyEvent) => void |
Returns: Promise<PluginListenerHandle>
返回: 5.1.0
isAutoUpdateAvailable() => Promise<AutoUpdateAvailable>标题:isAutoUpdateAvailable()方法
Returns: Promise<AutoUpdateAvailable>
getNextBundle()
getNextBundle()getNextBundle() => Promise<BundleInfo | null>获取将在应用重载时使用的下一个捆绑包。 如果没有设置下一个捆绑包,则返回 null。
返回: Promise<BundleInfo | null>
自: 6.8.0
setShakeMenu(…)
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 |
关于Capgo
BundleInfo| 属性 | 类型 |
|---|---|
id | string |
version | string |
downloaded | string |
checksum | string |
status | BundleStatus |
BundleInfo
更新地址| 属性 | 类型 |
|---|---|
url | string |
统计地址
StatsUrl| 属性 | 类型 |
|---|---|
url | string |
context:Capgo主页
频道URL| 属性 | 类型 |
|---|---|
url | string |
DownloadOptions
下载选项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 | string | 要下载的捆绑包 zip 文件的 URL (例如:dist.zip)。 (这可以是任何 URL。 例如:Amazon S3,一个 GitHub 标签,任何您托管的捆绑包的其他地方。) | ||
version | string | 捆绑包的版本 code/名称 | ||
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| Prop | 类型 |
|---|---|
id | string |
BundleListResult
BundleListResult| Prop | 类型 |
|---|---|
bundles | BundleInfo[] |
ListOptions
ListOptions| Prop | 类型 | 简介 | 默认 | 自 |
|---|---|---|---|---|
raw | boolean | 是否返回原始包列表或清单。如果为真,列表将尝试读取内部数据库而不是磁盘上的文件。 | false | 6.14.0 |
重置选项
重置选项| 属性 | 类型 |
|---|---|
toLastSuccessful | boolean |
当前包结果
当前包结果| 属性 | 类型 |
|---|---|
bundle | BundleInfo |
native | string |
多阶段条件
多阶段条件| 属性 | 类型 |
|---|---|
delayConditions | DelayCondition[] |
延迟条件
延迟条件| 属性 | 类型 | 描述 |
|---|---|---|
kind | DelayUntilNext | 设置延迟条件 |
value | string |
最新版本
最新版本| 属性 | 类型 | 关于Capgo页面 | 描述 |
|---|---|---|---|
version | string | 自 | 4.0.0 |
checksum | string | 6 | |
major | boolean | ||
message | string | ||
sessionKey | string | ||
error | string | ||
old | string | ||
url | string | ||
manifest | ManifestEntry[] | 6.1 |
获取最新版本的结果
获取最新版本选项| 属性 | 类型 | 关于Capgo页面 | 获取最新版本选项部分 | 描述 |
|---|---|---|---|---|
channel | string | 获取最新版本的频道 | undefined | 6.8.0 |
ChannelRes
频道资源| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
status | string | 频道设置的当前状态 | 4.7.0 |
error | string | ||
message | string |
SetChannelOptions
频道设置选项| 属性 | 类型 |
|---|---|
channel | string |
triggerAutoUpdate | boolean |
UnsetChannelOptions
关于 “UnsetChannelOptions”| 属性 | 类型 |
|---|---|
triggerAutoUpdate | boolean |
获取频道信息
获取频道结果| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
channel | string | 获取频道状态 | 4.8.0 |
error | string | ||
message | string | ||
status | string | ||
allowSet | boolean |
ListChannelsResult
ListChannelsResult| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
channels | ChannelInfo[] | 可用渠道列表 | 7.5.0 |
ChannelInfo
渠道信息| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
id | number | 数字频道ID | 7.5.0 |
name | string | 渠道名称 | 7.5.0 |
public | boolean | 如果为 true,则这是一个默认/备份频道。设备无法自行将其分配到公共频道。相反,当设备使用 unsetChannel())将其频道重写移除时,它将自动从匹配的公共频道接收更新。 | 7.5.0 |
allow_self_set | boolean | 如果为 true,则设备可以使用 setChannel())显式将其分配到此频道。通常用于 beta 测试、 A/B 测试或优惠升级跟踪。 | 7.5.0 |
频道命令使用频道 name,而不是此数字 id.
设置自定义 ID 选项
设置自定义 ID 选项| 属性 | 类型 |
|---|---|
customId | string |
__CAPGO_KEEP_0__
内置版本| Prop | 类型 |
|---|---|
version | string |
__CAPGO_KEEP_0__
设备ID| Prop | 类型 |
|---|---|
deviceId | string |
__CAPGO_KEEP_1__
插件版本| Prop | 类型 |
|---|---|
version | string |
自动更新开关
自动更新开关| 属性 | 类型 |
|---|---|
enabled | boolean |
关于Capgo
插件监听器句柄| 属性 | 类型 |
|---|---|
remove | () => Promise<void> |
下载事件
下载事件| 属性 | 类型 | 概述 | 自 |
|---|---|---|---|
percent | number | 下载进度,范围为0到100。 | 4.0.0 |
bundle | BundleInfo |
无需事件
无需事件| 属性 | 类型 | 概述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 下载进度,范围为0到100。 | 4.0.0 |
更新可用事件
关于Capgo页面| 属性 | 类型 | 关于Capgo | 描述 |
|---|---|---|---|
bundle | BundleInfo | 自 | 4.0.0 |
下载进度,范围为0到100
下载完成事件| 属性 | 类型 | 关于Capgo | 描述 |
|---|---|---|---|
bundle | BundleInfo | 下载完成事件 | 4.0.0 |
MajorAvailableEvent
关于“MajorAvailableEvent”| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
version | string | 当有新主要包可用时触发 | 4.0.0 |
UpdateFailedEvent
关于“UpdateFailedEvent”| 属性 | 类型 | 描述 | 自从 |
|---|---|---|---|
bundle | BundleInfo | 安装更新失败时触发。 | 4.0.0 |
下载失败事件
下载失败事件| 属性 | 类型 | 关于Capgo页面 | 自从 |
|---|---|---|---|
version | string | 安装下载失败时触发。 | 4.0.0 |
应用就绪事件
应用就绪事件| 属性 | 类型 | 描述 | 自 |
|---|---|---|---|
bundle | BundleInfo | 应用程序准备就绪时发出。 | 5.2.0 |
status | string |
自动更新可用
自动更新可用| 属性 | 类型 |
|---|---|
available | boolean |
设置抖动菜单选项
设置抖动菜单选项| 属性 | 类型 |
|---|---|
enabled | boolean |
ShakeMenuEnabled
关于 ShakeMenuEnabled| 属性 | 类型 |
|---|---|
enabled | boolean |
类型别名
关于类型别名BundleStatus
Bundle状态等待:该捆绑包正在等待下一个捆绑包的准备 设置 正在下载:该捆绑包正在下载中 成功:该捆绑包已下载并准备好 设置 作为下一个捆绑包。 错误:捆绑包下载失败。
‘success’ | ‘error’ | ‘pending’ | ‘downloading’
延迟到下一个
标题:延迟到下一个‘background’ | ‘kill’ | ‘nativeVersion’ | ‘date’
继续从功能和设置
标题:继续从功能和设置如果您正在使用 功能和设置 来规划仪表板和API操作,连接它到 使用@capgo/capacitor-updater 为native能力在使用@capgo/capacitor-updater API概述 为实现细节在API概述 简介 为简介中的实现细节 API 键 为API Keys中的实现细节,并 设备 为设备的实现细节。