Skip to content

Latest commit

 

History

History
171 lines (87 loc) · 3.85 KB

LocalPackage.md

File metadata and controls

171 lines (87 loc) · 3.85 KB

@appzung/react-native-code-push v11.0.0-rc7


@appzung/react-native-code-push / LocalPackage

Interface: LocalPackage

Represents a downloaded update that is either already running, or has been installed and is pending an app restart.

Extends

Properties

appVersion

appVersion: string

The app binary version that this update is dependent on. This is the value that was specified via the --target-binary-version parameter when calling the CLI's release command.

Inherited from

Package.appVersion


description

description: string

The description of the update. This is the same value that you specified in the CLI when you released the update.

Inherited from

Package.description


failedInstall

failedInstall: boolean

Indicates whether this update has been previously installed but was rolled back.

The sync method will automatically ignore updates which have previously failed, so you only need to worry about this property if using checkForUpdate.

Inherited from

Package.failedInstall


isFirstRun

isFirstRun: boolean

Indicates whether this is the first time the update has been run after being installed.

This is useful for determining whether you would like to show a "What's New?" UI to the end user after installing an update.

Inherited from

Package.isFirstRun


isMandatory

isMandatory: boolean

Indicates whether the update is considered mandatory. This is the value that was specified in the CLI when the update was released.

Inherited from

Package.isMandatory


isPending

isPending: boolean

Indicates whether this update is in a "pending" state. When true, that means the update has been downloaded and installed, but the app restart needed to apply it hasn't occurred yet, and therefore, its changes aren't currently visible to the end-user.

Inherited from

Package.isPending


label

label: string

The internal label automatically given to the update by the CodePush server. This value uniquely identifies the update within its release channel.

Inherited from

Package.label


packageHash

packageHash: string

The SHA hash value of the update.

Inherited from

Package.packageHash


packageSize

packageSize: number

The size of the code contained within the update, in bytes.

Inherited from

Package.packageSize


releaseChannelPublicId

releaseChannelPublicId: string

The release channel public ID that was used to originally download this update.

Inherited from

Package.releaseChannelPublicId

Methods

install()

install(installMode?, minimumBackgroundDuration?, onUpdateInstalled?): Promise<void>

Installs the update by saving it to the location on disk where the runtime expects to find the latest version of the app.

Parameters

installMode?

InstallMode

Indicates when you would like the update changes to take effect for the end-user.

minimumBackgroundDuration?

number

For resume-based installs, this specifies the number of seconds the app needs to be in the background before forcing a restart. Defaults to 0 if unspecified.

onUpdateInstalled?

() => void | Promise<void>

An optional promise called after app installation

Returns

Promise<void>