Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit d218c32

Browse files
committed
Fixing references to getCurrentPackage
1 parent 44153a8 commit d218c32

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ We try our best to maintain backwards compatability of our plugin with previous
4848
| <0.14.0 | **Unsupported** |
4949
| v0.14.0 | v1.3.0 *(introduced Android support)* |
5050
| v0.15.0-v0.18.0 | v1.4.0-v1.6.0 *(introduced iOS asset support)* |
51-
| v0.19.0-v0.24.0 | v1.7.0+ *(introduced Android asset support)* |
52-
| v0.25.0+ | TBD :) We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is.
51+
| v0.19.0-v0.25.0 | v1.7.0+ *(introduced Android asset support)* |
52+
| v0.26.0+ | TBD :) We work hard to respond to new RN releases, but they do occasionally break us. We will update this chart with each RN release, so that users can check to see what our "official" support is.
5353

5454
## Supported Components
5555

@@ -430,9 +430,12 @@ This method returns a `Promise` which resolves to one of two possible values:
430430
1. `null` if an update with the specified state doesn't currently exist. This occurs in the following scenarios:
431431

432432
1. The end-user hasn't installed any CodePush updates yet, and therefore, no metadata is available for any updates, regardless what you specify as the `updateState` parameter.
433-
1. The end-user installed an update of the binary (e.g. from the store), which cleared away the old CodePush updates, and gave precedence back to the JS binary in the binary.
434-
1. The `updateState` parameter is set to `UpdateState.RUNNING`, but the app isn't currently running a CodePush update. There may be a pending update, which requires an app restart to become active.
435-
1. The `updateState` parameter is set to `UpdateState.PENDING`, but the app doesn't have any pending updates.
433+
434+
2. The end-user installed an update of the binary (e.g. from the store), which cleared away the old CodePush updates, and gave precedence back to the JS binary in the binary. Therefore, it would exhibit the same behavior as #1
435+
436+
3. The `updateState` parameter is set to `UpdateState.RUNNING`, but the app isn't currently running a CodePush update. There may be a pending update, but the app hasn't been restarted yet in order to make it active.
437+
438+
4. The `updateState` parameter is set to `UpdateState.PENDING`, but the app doesn't have any currently pending updates.
436439

437440
2. A [`LocalPackage`](#localpackage) instance which represents the metadata for the currently requested CodePush update (either the running or pending).
438441

@@ -456,15 +459,17 @@ codePush.getUpdateMetadata(UpdateState.PENDING).then((update) => {
456459
});
457460
```
458461
459-
#### codePush.notifyApplicationReady
462+
#### codePush.notifyAppReady
460463
461464
```javascript
462-
codePush.notifyApplicationReady(): Promise<void>;
465+
codePush.notifyAppReady(): Promise<void>;
463466
```
464467
465468
Notifies the CodePush runtime that a freshly installed update should be considered successful, and therefore, an automatic client-side rollback isn't necessary. It is mandatory to call this function somewhere in the code of the updated bundle. Otherwise, when the app next restarts, the CodePush runtime will assume that the installed update has failed and roll back to the previous version. This behavior exists to help ensure that your end users aren't blocked by a broken update.
466469
467-
If you are using the `sync` function, and doing your update check on app start, then you don't need to manually call `notifyApplicationReady` since `sync` will call it for you. This behavior exists due to the assumption that the point at which `sync` is called in your app represents a good approximation of a successful startup.
470+
If you are using the `sync` function, and doing your update check on app start, then you don't need to manually call `notifyAppReady` since `sync` will call it for you. This behavior exists due to the assumption that the point at which `sync` is called in your app represents a good approximation of a successful startup.
471+
472+
*NOTE: This method is also aliased as `notifyApplicationReady` (for backwards compatibility).*
468473
469474
#### codePush.restartApp
470475
@@ -611,15 +616,15 @@ The `sync` method can be called anywhere you'd like to check for an update. That
611616
612617
#### Package objects
613618
614-
The `checkForUpdate` and `getCurrentPackage` methods return promises, that when resolved, provide acces to "package" objects. The package represents your code update as well as any extra metadata (e.g. description, mandatory?). The CodePush API has the distinction between the following types of packages:
619+
The `checkForUpdate` and `getUpdateMetadata` methods return `Promise` objects, that when resolved, provide acces to "package" objects. The package represents your code update as well as any extra metadata (e.g. description, mandatory?). The CodePush API has the distinction between the following types of packages:
615620
616621
* [LocalPackage](#localpackage): Represents a downloaded update that is either already running, or has been installed and is pending an app restart.
617622
618623
* [RemotePackage](#remotepackage): Represents an available update on the CodePush server that hasn't been downloaded yet.
619624
620625
##### LocalPackage
621626
622-
Contains details about an update that has been downloaded locally or already installed. You can get a reference to an instance of this object either by calling the module-level `getCurrentPackage` method, or as the value of the promise returned by the `RemotePackage.download` method.
627+
Contains details about an update that has been downloaded locally or already installed. You can get a reference to an instance of this object either by calling the module-level `getUpdateMetadata` method, or as the value of the promise returned by the `RemotePackage.download` method.
623628
624629
###### Properties
625630
- __appVersion__: The app binary version that this update is dependent on. This is the value that was specified via the `appStoreVersion` parameter when calling the CLI's `release` command. *(String)*

0 commit comments

Comments
 (0)