Skip to content

Commit

Permalink
fix: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Nov 2, 2022
1 parent 1b494e1 commit 41b2be0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Capacitor Updator works by unzipping a compiled app bundle to the native device
* [`setMultiDelay(...)`](#setmultidelay)
* [`setDelay(...)`](#setdelay)
* [`cancelDelay()`](#canceldelay)
* [`getLatest(...)`](#getlatest)
* [`getLatest()`](#getlatest)
* [`addListener('download', ...)`](#addlistenerdownload)
* [`addListener('noNeedUpdate', ...)`](#addlistenernoneedupdate)
* [`addListener('updateAvailable', ...)`](#addlistenerupdateavailable)
Expand Down Expand Up @@ -177,7 +177,7 @@ Notify Capacitor Updater that the current bundle is working (a rollback will occ
download(options: { url: string; version: string; }) => Promise<BundleInfo>
```

Download a new version from the provided URL, it should be a zip file, with files inside or with a unique id inside with all your files
Download a new bundle from the provided URL, it should be a zip file, with files inside or with a unique id inside with all your files

| Param | Type |
| ------------- | ---------------------------------------------- |
Expand Down Expand Up @@ -241,7 +241,7 @@ Delete bundle in storage
list() => Promise<{ bundles: BundleInfo[]; }>
```

Get all available versions
Get all available bundles

**Returns:** <code>Promise&lt;{ bundles: BundleInfo[]; }&gt;</code>

Expand All @@ -254,7 +254,7 @@ Get all available versions
reset(options?: { toLastSuccessful?: boolean | undefined; } | undefined) => Promise<void>
```

Set the `builtin` version (the one sent to Apple store / Google play store ) as current version
Set the `builtin` bundle (the one sent to Apple store / Google play store ) as current bundle

| Param | Type |
| ------------- | -------------------------------------------- |
Expand Down Expand Up @@ -334,17 +334,13 @@ Cancel delay to updates as usual
--------------------


### getLatest(...)
### getLatest()

```typescript
getLatest(options: { delay: boolean; }) => Promise<latestVersion>
getLatest() => Promise<latestVersion>
```

Get Latest version available from update Url

| Param | Type |
| ------------- | -------------------------------- |
| **`options`** | <code>{ delay: boolean; }</code> |
Get Latest bundle available from update Url

**Returns:** <code>Promise&lt;<a href="#latestversion">latestVersion</a>&gt;</code>

Expand Down Expand Up @@ -516,12 +512,12 @@ Listen for download fail event in the App, let you know when download has fail f
### getDeviceId()

```typescript
getDeviceId() => Promise<{ id: string; }>
getDeviceId() => Promise<{ deviceId: string; }>
```

Get unique ID used to identify device (sent to auto update server)

**Returns:** <code>Promise&lt;{ id: string; }&gt;</code>
**Returns:** <code>Promise&lt;{ deviceId: string; }&gt;</code>

--------------------

Expand Down Expand Up @@ -648,9 +644,9 @@ removeAllListeners() => Promise<void>

#### MajorAvailableEvent

| Prop | Type | Description | Since |
| ------------- | ------------------- | ------------------------------------------- | ----- |
| **`version`** | <code>string</code> | Emit when a new major version is available. | 4.0.0 |
| Prop | Type | Description | Since |
| ------------- | ------------------- | ------------------------------------------ | ----- |
| **`version`** | <code>string</code> | Emit when a new major bundle is available. | 4.0.0 |


#### UpdateFailedEvent
Expand Down
10 changes: 10 additions & 0 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ declare module '@capacitor/cli' {
* @example https://example.com/api/stats
*/
statsUrl?: string;

/**
* Allow the plugin to automatically check for updates on app launch on emulator devices in production app.
*
* This is useful for CI/CD who send builds to google at each commit.
*
* @default true
* @example false
*/
allowEmulatorProd?: boolean;
};
}
}
Expand Down

0 comments on commit 41b2be0

Please sign in to comment.