You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0de0534
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/docs/docs/plugin/api.md
+66-8Lines changed: 66 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ CapacitorUpdater can be configured with these options:
22
22
|**`resetWhenUpdate`**|`boolean`| Automatically delete previous downloaded bundles when a newer native app bundle is installed to the device. Setting this to false can broke the auto update flow if the user download from the store a native app bundle that is older than the current downloaded bundle. Upload will be prevented by channel setting downgrade_under_native. Only available for Android and iOS. |`true`||
23
23
|**`updateUrl`**|`string`| Configure the URL / endpoint to which update checks are sent. Only available for Android and iOS. |`https://plugin.capgo.app/updates`||
24
24
|**`channelUrl`**|`string`| Configure the URL / endpoint for channel operations. Only available for Android and iOS. |`https://plugin.capgo.app/channel_self`||
25
-
|**`statsUrl`**|`string`| Configure the URL / endpoint to which update statistics are sent. Only available for Android and iOS. Set to "" to disable stats reporting. Native stats include update lifecycle events, app health signals such as crashes, Android ANRs, low-memory exits, iOS memory warnings, and WebView health signals such as JavaScript errors, unhandled promise rejections, resource load failures, WebView renderer exits, unclean WebView restarts, app launch readiness timing, and WebView load milestones when available. |`https://plugin.capgo.app/stats`||
25
+
|**`statsUrl`**|`string`| Configure the URL / endpoint to which update statistics are sent. Only available for Android and iOS. Set to "" to disable stats reporting. Native stats include update lifecycle events, app health signals such as crashes, Android ANRs, low-memory exits, iOS memory warnings, and WebView health signals such as JavaScript errors, unhandled promise rejections, resource load failures, WebView renderer exits, unclean WebView restarts, app launch readiness timing, and WebView load milestones when available. Failed background update checks that never start a download (network errors, timeouts, non-2xx responses, unreadable payloads) are reported as `update_check_error` with `metadata.error` and optional `metadata.status_code`, not as `download_fail`. Self-hosted Capgo backends must allow the `update_check_error` stats action. |`https://plugin.capgo.app/stats`||
26
26
|**`publicKey`**|`string`| Configure the public key for end to end live update encryption Version 2 Only available for Android and iOS. |`undefined`| 6.2.0 |
27
27
|**`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. Only available for Android and iOS. |`undefined`| 4.17.48 |
28
28
|**`directUpdate`**|`boolean \| 'always' \| 'atInstall' \| 'onLaunch'`| Configure when the plugin should direct install updates. Only for autoUpdate mode. Instant apply (`atInstall`, `onLaunch`, `always`) should be uploaded with `--delta` so the update does not slow the user experience. A full zip, especially over 10MB, is relatively slow for users. These modes require `autoSplashscreen: true` and `@capacitor/splash-screen` installed with `launchAutoHide: false`. This flag makes the CLI upload delta in CI and ask for confirmation in local uploads. - false: Never do direct updates - atInstall: Same as `"atInstall"` for {@link autoUpdate} - onLaunch: Same as `"onLaunch"` for {@link autoUpdate} - always: Same as `"always"` for {@link autoUpdate} - true: (deprecated) Same as "always" for backward compatibility |`false`| 5.1.0 |
@@ -54,6 +54,14 @@ CapacitorUpdater can be configured with these options:
54
54
|**`shakeMenu`**|`boolean`| Enable the native preview menu gesture while a preview session is active. Outside preview sessions this preview menu is ignored, unless {@link PluginsConfig.CapacitorUpdater.allowShakeChannelSelector} is enabled. |`false`| 7.5.0 |
55
55
|**`shakeMenuGesture`**|`ShakeMenuGesture`| Choose which native gesture opens the preview/channel menu. This applies to both {@link PluginsConfig.CapacitorUpdater.shakeMenu} and {@link PluginsConfig.CapacitorUpdater.allowShakeChannelSelector}. Only available for Android and iOS. |`'shake'`| 8.48.0 |
56
56
|**`allowShakeChannelSelector`**|`boolean`| Enable the native menu gesture to show a channel selector menu for switching between update channels. If {@link PluginsConfig.CapacitorUpdater.shakeMenu} is also enabled while a preview session is active, the shake menu includes both preview actions and channel switching. The native gesture can be changed with {@link PluginsConfig.CapacitorUpdater.shakeMenuGesture}. Only available for Android and iOS. |`false`| 8.43.0 |
57
+
|**`nativeUpdatePrompt`**|`boolean`| When enabled, show a native dialog prompting the user to install a newer native app from the App Store or Play Store. The prompt appears when a live update is blocked because the device native app is too old, including backend `disable_auto_update_*` responses, `store_update_required`, and `breakingAvailable` / `majorAvailable` flows. Only available for Android and iOS. No-op on web. |`false`| 8.53.0 |
58
+
|**`nativeUpdatePromptTitle`**|`string`| Optional title for the native store update dialog shown when {@link PluginsConfig.CapacitorUpdater.nativeUpdatePrompt} is enabled. Only available for Android and iOS. |`"Update available"`| 8.53.0 |
59
+
|**`nativeUpdatePromptMessage`**|`string`| Optional message body for the native store update dialog shown when {@link PluginsConfig.CapacitorUpdater.nativeUpdatePrompt} is enabled. Only available for Android and iOS. |`A short message explaining that a newer native app is available in the store.`| 8.53.0 |
60
+
|**`nativeUpdatePromptUpdateButton`**|`string`| Optional label for the primary action button that opens the store or starts an in-app update on Android. Only available for Android and iOS. |`"Update"`| 8.53.0 |
61
+
|**`nativeUpdatePromptLaterButton`**|`string`| Optional label for the dismiss action on the native store update dialog. Only available for Android and iOS. |`"Not now"`| 8.53.0 |
62
+
|**`nativeUpdatePromptCountry`**|`string`| Optional ISO 3166-1 alpha-2 country filter. When set, the prompt is shown only when the device region matches one of the comma-separated country codes (for example `"US"` or `"US,CA"`). Only available for Android and iOS. |`undefined (show in all regions)`| 8.53.0 |
63
+
|**`nativeUpdatePromptOnStoreCheck`**|`boolean`| When {@link PluginsConfig.CapacitorUpdater.nativeUpdatePrompt} is enabled, also show the dialog when {@link CapacitorUpdaterPlugin.getAppUpdateInfo} reports that a store update is available. Only available for Android and iOS. |`false`| 8.53.0 |
64
+
|**`nativeUpdatePromptCooldownHours`**|`number`| Minimum hours between native update prompts for the same native app version. Also limited to once per app session. Only available for Android and iOS. |`24`| 8.53.0 |
57
65
58
66
59
67
</docgen-config>
@@ -99,6 +107,7 @@ CapacitorUpdater can be configured with these options:
Configure conditions that must be met before a pending update is applied.
819
828
820
829
After calling {@link next} to queue an update, use this method to control when it gets applied.
821
-
The update will only be installed after ALL specified conditions are satisfied.
830
+
By default, the update is installed only after **all** specified conditions are satisfied (`conditionMode: 'and'`).
831
+
Set `conditionMode` to `'or'` to apply the update as soon as **any** condition is met.
822
832
823
833
Available condition types:
824
-
-`background`: Wait for the app to be backgrounded. Optionally specify duration in milliseconds.
825
-
-`kill`: Wait for the app to be killed and relaunched (**Note:** Current behavior triggers update immediately on kill, not on next background. This will be fixed in v8.)
834
+
-`background`: Wait until the app has spent more than the configured time in the background (see value formats below).
835
+
-`kill`: The condition clears on the next launch and can also clear during Android activity destruction; activity destruction does not prove that the app process ended. Automatic installation waits for the next background, because it runs from appMovedToBackground. Calling {@link reload} can apply the pending bundle immediately.
826
836
-`date`: Wait until a specific date/time (ISO 8601 format)
827
837
-`nativeVersion`: Wait until the native app is updated to a specific version
828
838
829
839
Condition value formats:
830
-
-`background`: Number in milliseconds (e.g., `"300000"` for 5 minutes), or omit for immediate
840
+
-`background`: Time in milliseconds in background must exceed this value before the condition can clear on return to foreground (e.g., `"300000"` for more than 5 minutes; exactly `300000` ms does not clear). Omit `value`or use `"0"` to clear after one background-and-return cycle; the update installs on the following background.
831
841
-`kill`: No value needed
832
842
-`date`: ISO 8601 date string (e.g., `"2025-12-31T23:59:59Z"`)
833
843
-`nativeVersion`: Version string (e.g., `"2.0.0"`)
@@ -849,8 +859,9 @@ Condition value formats:
849
859
**Example**
850
860
851
861
```ts
852
-
// Update after user kills app OR after 5 minutes in background
862
+
// Update after kill condition clears on launch AND background time exceeds 5 minutes
0 commit comments