@capgo/capacitor-updater 8.45.11 → 8.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +1 -1
- package/README.md +40 -2
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +558 -12
- package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +45 -0
- package/dist/docs.json +50 -1
- package/dist/esm/definitions.d.ts +46 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +4 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +4 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/AppHealthTracker.swift +82 -0
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +66 -8
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +9 -0
- package/ios/Sources/CapacitorUpdaterPlugin/InternalUtils.swift +1 -0
- package/ios/Sources/CapacitorUpdaterPlugin/WebViewStatsReporter.swift +276 -0
- package/package.json +10 -1
package/Package.swift
CHANGED
|
@@ -11,7 +11,7 @@ let package = Package(
|
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
13
|
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0"),
|
|
14
|
-
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.
|
|
14
|
+
.package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.12.0")),
|
|
15
15
|
.package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.20"),
|
|
16
16
|
.package(url: "https://github.com/mrackwitz/Version.git", exact: "0.8.0"),
|
|
17
17
|
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.7.0")
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Capacitor updater
|
|
2
|
-
|
|
2
|
+
<a href="https://capgo.app/"><img src="https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-updater" alt="Capgo - Instant updates for Capacitor" /></a>
|
|
3
3
|
[](https://discord.com/invite/VnYRvBfgA6)
|
|
4
4
|
<a href="https://discord.com/invite/VnYRvBfgA6"><img src="https://img.shields.io/discord/912707985829163099?color=%237289DA&label=Discord" alt="Discord">
|
|
5
5
|
[](https://www.npmjs.com/package/@capgo/capacitor-updater)
|
|
@@ -296,7 +296,7 @@ CapacitorUpdater can be configured with these options:
|
|
|
296
296
|
| **`resetWhenUpdate`** | <code>boolean</code> | 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. | <code>true</code> | |
|
|
297
297
|
| **`updateUrl`** | <code>string</code> | Configure the URL / endpoint to which update checks are sent. Only available for Android and iOS. | <code>https://plugin.capgo.app/updates</code> | |
|
|
298
298
|
| **`channelUrl`** | <code>string</code> | Configure the URL / endpoint for channel operations. Only available for Android and iOS. | <code>https://plugin.capgo.app/channel_self</code> | |
|
|
299
|
-
| **`statsUrl`** | <code>string</code> | Configure the URL / endpoint to which update statistics are sent. Only available for Android and iOS. Set to "" to disable stats reporting.
|
|
299
|
+
| **`statsUrl`** | <code>string</code> | 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, and unclean WebView restarts when available. | <code>https://plugin.capgo.app/stats</code> | |
|
|
300
300
|
| **`publicKey`** | <code>string</code> | Configure the public key for end to end live update encryption Version 2 Only available for Android and iOS. | <code>undefined</code> | 6.2.0 |
|
|
301
301
|
| **`version`** | <code>string</code> | 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. | <code>undefined</code> | 4.17.48 |
|
|
302
302
|
| **`directUpdate`** | <code>boolean \| 'always' \| 'atInstall' \| 'onLaunch'</code> | Configure when the plugin should direct install updates. Only for autoUpdate mode. Works well for apps less than 10MB and with uploads done using --delta flag. Zip or apps more than 10MB will be relatively slow for users to update. - false: Never do direct updates (use default behavior: download at start, set when backgrounded) - atInstall: Direct update only when app is installed, updated from store, otherwise act as directUpdate = false - onLaunch: Direct update only on app installed, updated from store or after app kill, otherwise act as directUpdate = false - always: Direct update in all previous cases (app installed, updated from store, after app kill or app resume), never act as directUpdate = false - true: (deprecated) Same as "always" for backward compatibility Activate this flag will automatically make the CLI upload delta in CICD envs and will ask for confirmation in local uploads. Only available for Android and iOS. | <code>false</code> | 5.1.0 |
|
|
@@ -449,6 +449,7 @@ export default config;
|
|
|
449
449
|
* [`reload()`](#reload)
|
|
450
450
|
* [`setMultiDelay(...)`](#setmultidelay)
|
|
451
451
|
* [`cancelDelay()`](#canceldelay)
|
|
452
|
+
* [`triggerUpdateCheck()`](#triggerupdatecheck)
|
|
452
453
|
* [`getLatest(...)`](#getlatest)
|
|
453
454
|
* [`setChannel(...)`](#setchannel)
|
|
454
455
|
* [`unsetChannel(...)`](#unsetchannel)
|
|
@@ -907,6 +908,33 @@ This is useful when:
|
|
|
907
908
|
--------------------
|
|
908
909
|
|
|
909
910
|
|
|
911
|
+
#### triggerUpdateCheck()
|
|
912
|
+
|
|
913
|
+
```typescript
|
|
914
|
+
triggerUpdateCheck() => Promise<TriggerUpdateCheckResult>
|
|
915
|
+
```
|
|
916
|
+
|
|
917
|
+
Trigger the native auto-update check/download pipeline immediately.
|
|
918
|
+
|
|
919
|
+
This starts the same background update flow used when the app moves to the
|
|
920
|
+
foreground with auto-update enabled. It is useful for native integrations
|
|
921
|
+
such as a silent push notification asking the app to check for a Capgo
|
|
922
|
+
bundle without reimplementing the update protocol in JavaScript.
|
|
923
|
+
|
|
924
|
+
The promise resolves after the native background work has been queued, not
|
|
925
|
+
after the update has been downloaded or installed. Listen to updater events
|
|
926
|
+
such as `updateAvailable`, `downloadComplete`, `downloadFailed`, and
|
|
927
|
+
`noNeedUpdate` for the final result.
|
|
928
|
+
|
|
929
|
+
Native support is available on iOS and Android. On Web, this method returns
|
|
930
|
+
a result with `status: 'unavailable'`. Native platforms also return
|
|
931
|
+
`unavailable` when the native auto-update system is disabled.
|
|
932
|
+
|
|
933
|
+
**Returns:** <code>Promise<<a href="#triggerupdatecheckresult">TriggerUpdateCheckResult</a>></code>
|
|
934
|
+
|
|
935
|
+
--------------------
|
|
936
|
+
|
|
937
|
+
|
|
910
938
|
#### getLatest(...)
|
|
911
939
|
|
|
912
940
|
```typescript
|
|
@@ -2115,6 +2143,16 @@ If you don't use backend, you need to provide the URL and version of the bundle.
|
|
|
2115
2143
|
| **`value`** | <code>string</code> | |
|
|
2116
2144
|
|
|
2117
2145
|
|
|
2146
|
+
##### TriggerUpdateCheckResult
|
|
2147
|
+
|
|
2148
|
+
Result returned after requesting an immediate native auto-update check.
|
|
2149
|
+
|
|
2150
|
+
| Prop | Type | Description |
|
|
2151
|
+
| ------------ | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2152
|
+
| **`status`** | <code>'queued' \| 'already_running' \| 'unavailable'</code> | Native trigger state: `queued` when a check was queued, `already_running` when the native update pipeline is already active, or `unavailable` on Web or when native auto-update is disabled. |
|
|
2153
|
+
| **`queued`** | <code>boolean</code> | Whether a new native update check was queued. This is `true` only when `status` is `queued`; otherwise it is `false`. |
|
|
2154
|
+
|
|
2155
|
+
|
|
2118
2156
|
##### LatestVersion
|
|
2119
2157
|
|
|
2120
2158
|
| Prop | Type | Description | Since |
|