Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ If you would like your app to discover updates more quickly, you can also choose
withCodePush({ checkFrequency: CheckFrequency.ON_APP_RESUME })(MyApp);
```

Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), eg. in a staging environment, you can call [`CodePush.sync()`](docs/api-js.md#codepushsync) at any time with your desired `SyncOptions`, and turn off CodePush's automatic checking by specifying a manual `checkFrequency`:
Alternatively, if you want fine-grained control over when the check happens (like a button press or timer interval), eg. in a staging environment, you can call [`CodePush.sync()`](docs/api-js/functions/sync.md) at any time with your desired `SyncOptions`, and turn off CodePush's automatic checking by specifying a manual `checkFrequency`:

```javascript
import withCodePush, { CheckFrequency, InstallMode } from '@appzung/react-native-code-push';
Expand All @@ -169,7 +169,7 @@ class MyApp extends Component {
export default withCodePush({ checkFrequency: CheckFrequency.MANUAL })(MyApp);
```

If you would like to display an update confirmation dialog (an "active install"), configure when an available update is installed (like force an immediate restart) or customize the update experience in any other way, refer to the [`codePush()`](docs/api-js.md#codepush) API reference for information on how to tweak this default behavior.
If you would like to display an update confirmation dialog (an "active install"), configure when an available update is installed (like force an immediate restart) or customize the update experience in any other way, refer to the [`withCodePush()`](docs/api-js/functions/withCodePush.md) API reference for information on how to tweak this default behavior.

## Releasing updates

Expand Down Expand Up @@ -252,7 +252,7 @@ This is not necessarily the case for `updateDialog`, since it won't force the us

## API Reference

- [JavaScript API](docs/api-js.md)
- [JavaScript API](docs/api-js/README.md)
- [Objective-C API Reference (iOS)](docs/api-ios.md)
- [Java API Reference (Android)](docs/api-android.md)

Expand Down
557 changes: 0 additions & 557 deletions docs/api-js.md

This file was deleted.

55 changes: 55 additions & 0 deletions docs/api-js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
**@appzung/react-native-code-push**

---

# @appzung/react-native-code-push

## Enumerations

- [CheckFrequency](enumerations/CheckFrequency.md)
- [DeploymentStatus](enumerations/DeploymentStatus.md)
- [InstallMode](enumerations/InstallMode.md)
- [SyncStatus](enumerations/SyncStatus.md)
- [UpdateState](enumerations/UpdateState.md)

## Interfaces

- [CodePushOptions](interfaces/CodePushOptions.md)
- [DownloadProgress](interfaces/DownloadProgress.md)
- [LocalPackage](interfaces/LocalPackage.md)
- [Package](interfaces/Package.md)
- [RemotePackage](interfaces/RemotePackage.md)
- [RollbackRetryOptions](interfaces/RollbackRetryOptions.md)
- [StatusReport](interfaces/StatusReport.md)
- [SyncOptions](interfaces/SyncOptions.md)
- [UpdateDialog](interfaces/UpdateDialog.md)

## Type Aliases

- [DownloadProgressCallback](type-aliases/DownloadProgressCallback.md)
- [HandleBinaryVersionMismatchCallback](type-aliases/HandleBinaryVersionMismatchCallback.md)
- [SyncStatusChangedCallback](type-aliases/SyncStatusChangedCallback.md)

## Variables

- [DEFAULT_UPDATE_DIALOG](variables/DEFAULT_UPDATE_DIALOG.md)

## Functions

- [allowRestart](functions/allowRestart.md)
- [checkForUpdate](functions/checkForUpdate.md)
- [clearUpdates](functions/clearUpdates.md)
- [disallowRestart](functions/disallowRestart.md)
- [getClientUniqueId](functions/getClientUniqueId.md)
- [getUpdateMetadata](functions/getUpdateMetadata.md)
- [notifyAppReady](functions/notifyAppReady.md)
- [resetClientUniqueId](functions/resetClientUniqueId.md)
- [restartApp](functions/restartApp.md)
- [sync](functions/sync.md)
- [withCodePush](functions/withCodePush.md)

## References

### default

Renames and re-exports [withCodePush](functions/withCodePush.md)
41 changes: 41 additions & 0 deletions docs/api-js/enumerations/CheckFrequency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[**@appzung/react-native-code-push**](../README.md)

---

[@appzung/react-native-code-push](../README.md) / CheckFrequency

# Enumeration: CheckFrequency

Defined in: [enums/CheckFrequency.enum.ts:4](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L4)

Indicates when you would like to check for (and install) updates from the CodePush server.

## Enumeration Members

### MANUAL

> **MANUAL**: `2`

Defined in: [enums/CheckFrequency.enum.ts:18](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L18)

Don't automatically check for updates, but only do it when `sync()` is manually called in app code.

---

### ON_APP_RESUME

> **ON_APP_RESUME**: `1`

Defined in: [enums/CheckFrequency.enum.ts:13](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L13)

When the app re-enters the foreground after being "backgrounded" (user pressed the home button, app launches a separate payment process, etc.)

---

### ON_APP_START

> **ON_APP_START**: `0`

Defined in: [enums/CheckFrequency.enum.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/CheckFrequency.enum.ts#L8)

When the app is fully initialized (or more specifically, when the root component is mounted).
31 changes: 31 additions & 0 deletions docs/api-js/enumerations/DeploymentStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[**@appzung/react-native-code-push**](../README.md)

---

[@appzung/react-native-code-push](../README.md) / DeploymentStatus

# Enumeration: DeploymentStatus

Defined in: [enums/DeploymentStatus.enum.ts:4](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/DeploymentStatus.enum.ts#L4)

Indicates the status of a deployment (after installing and restarting).

## Enumeration Members

### FAILED

> **FAILED**: `"DeploymentFailed"`

Defined in: [enums/DeploymentStatus.enum.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/DeploymentStatus.enum.ts#L8)

The deployment failed (and was rolled back).

---

### SUCCEEDED

> **SUCCEEDED**: `"DeploymentSucceeded"`

Defined in: [enums/DeploymentStatus.enum.ts:13](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/DeploymentStatus.enum.ts#L13)

The deployment succeeded.
60 changes: 60 additions & 0 deletions docs/api-js/enumerations/InstallMode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[**@appzung/react-native-code-push**](../README.md)

---

[@appzung/react-native-code-push](../README.md) / InstallMode

# Enumeration: InstallMode

Defined in: [enums/InstallMode.enum.ts:6](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L6)

Indicates when you would like an installed update to actually be applied.

## Enumeration Members

### IMMEDIATE

> **IMMEDIATE**: `number`

Defined in: [enums/InstallMode.enum.ts:12](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L12)

Indicates that you want to install the update and restart the app immediately.

This value is appropriate for debugging scenarios as well as when displaying an update prompt to the user, since they would expect to see the changes immediately after accepting the installation. Additionally, this mode can be used to enforce mandatory updates, since it removes the potentially undesired latency between the update installation and the next time the end user restarts or resumes the app.

---

### ON_NEXT_RESTART

> **ON_NEXT_RESTART**: `number`

Defined in: [enums/InstallMode.enum.ts:19](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L19)

Indicates that you want to install the update, but not forcibly restart the app.

When the app is "naturally" restarted (due the OS or end user killing it), the update will be seamlessly picked up. This value is appropriate when performing silent updates, since it would likely be disruptive to the end user if the app suddenly restarted out of nowhere, since they wouldn't have realized an update was even downloaded. This is the default mode used for both the `sync` and `LocalPackage.install` methods.

---

### ON_NEXT_RESUME

> **ON_NEXT_RESUME**: `number`

Defined in: [enums/InstallMode.enum.ts:27](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L27)

Indicates that you want to install the update, but don't want to restart the app until the next time the end user resumes it from the background.

This way, you don't disrupt their current session,but you can get the update in front of them sooner than having to wait for the next natural restart.
This value is appropriate for silent installs that can be applied on resume in a non-invasive way.

---

### ON_NEXT_SUSPEND

> **ON_NEXT_SUSPEND**: `number`

Defined in: [enums/InstallMode.enum.ts:34](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/InstallMode.enum.ts#L34)

Indicates that you want to install the update when the app is in the background,
but only after it has been in the background for "minimumBackgroundDuration" seconds (0 by default),
so that user context isn't lost unless the app suspension is long enough to not matter.
105 changes: 105 additions & 0 deletions docs/api-js/enumerations/SyncStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[**@appzung/react-native-code-push**](../README.md)

---

[@appzung/react-native-code-push](../README.md) / SyncStatus

# Enumeration: SyncStatus

Defined in: [enums/SyncStatus.enum.ts:4](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L4)

Indicates the current status of a sync operation.

## Enumeration Members

### AWAITING_USER_ACTION

> **AWAITING_USER_ACTION**: `6`

Defined in: [enums/SyncStatus.enum.ts:42](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L42)

An update is available, and a confirmation dialog was shown
to the end user. (This is only applicable when the `updateDialog` is used)

---

### CHECKING_FOR_UPDATE

> **CHECKING_FOR_UPDATE**: `5`

Defined in: [enums/SyncStatus.enum.ts:36](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L36)

The CodePush server is being queried for an update.

---

### DOWNLOADING_PACKAGE

> **DOWNLOADING_PACKAGE**: `7`

Defined in: [enums/SyncStatus.enum.ts:47](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L47)

An available update is being downloaded from the CodePush server.

---

### INSTALLING_UPDATE

> **INSTALLING_UPDATE**: `8`

Defined in: [enums/SyncStatus.enum.ts:52](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L52)

An available update was downloaded and is about to be installed.

---

### SYNC_IN_PROGRESS

> **SYNC_IN_PROGRESS**: `4`

Defined in: [enums/SyncStatus.enum.ts:31](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L31)

There is an ongoing `sync` operation running which prevents the current call from being executed.

---

### UNKNOWN_ERROR

> **UNKNOWN_ERROR**: `3`

Defined in: [enums/SyncStatus.enum.ts:26](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L26)

The `sync` operation encountered an unknown error.

---

### UP_TO_DATE

> **UP_TO_DATE**: `0`

Defined in: [enums/SyncStatus.enum.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L8)

The app is fully up-to-date with the configured release channel.

---

### UPDATE_IGNORED

> **UPDATE_IGNORED**: `2`

Defined in: [enums/SyncStatus.enum.ts:21](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L21)

The app had an optional update which the end user chose to ignore.
(This is only applicable when the `updateDialog` is used)

---

### UPDATE_INSTALLED

> **UPDATE_INSTALLED**: `1`

Defined in: [enums/SyncStatus.enum.ts:15](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/SyncStatus.enum.ts#L15)

An available update has been installed and will be run either immediately after the
`syncStatusChangedCallback` function returns or the next time the app resumes/restarts,
depending on the `InstallMode` specified in `SyncOptions`
45 changes: 45 additions & 0 deletions docs/api-js/enumerations/UpdateState.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[**@appzung/react-native-code-push**](../README.md)

---

[@appzung/react-native-code-push](../README.md) / UpdateState

# Enumeration: UpdateState

Defined in: [enums/UpdateState.enum.ts:6](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L6)

Indicates the state that an update is currently in.

## Enumeration Members

### LATEST

> **LATEST**: `number`

Defined in: [enums/UpdateState.enum.ts:24](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L24)

Indicates than an update represents the latest available release, and can be either currently running or pending.

---

### PENDING

> **PENDING**: `number`

Defined in: [enums/UpdateState.enum.ts:19](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L19)

Indicates than an update has been installed, but the app hasn't been restarted yet in order to apply it.

This can be useful for determining whether there is a pending update, which you may want to force a programmatic restart (via `restartApp`) in order to apply.

---

### RUNNING

> **RUNNING**: `number`

Defined in: [enums/UpdateState.enum.ts:12](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/enums/UpdateState.enum.ts#L12)

Indicates that an update represents the version of the app that is currently running.

This can be useful for identifying attributes about the app, for scenarios such as displaying the release description in a "what's new?" dialog or reporting the latest version to an analytics and/or crash reporting service.
19 changes: 19 additions & 0 deletions docs/api-js/functions/allowRestart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[**@appzung/react-native-code-push**](../README.md)

---

[@appzung/react-native-code-push](../README.md) / allowRestart

# Function: allowRestart()

> **allowRestart**(): `void`

Defined in: [allowRestart.ts:8](https://github.com/AppZung/react-native-code-push/blob/5f900017beec34f1e037ac881585c7f5fb00d5dd/src/allowRestart.ts#L8)

Allow CodePush to restart the app.

This is an advanced API and is only necessary if your app explicitly disallowed restarts via the `disallowRestart` method.

## Returns

`void`
Loading