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

Commit b9efd49

Browse files
committed
Doc improvements
1 parent 0824eb4 commit b9efd49

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ While the `sync` method tries to make it easy to perform silent and active updat
497497
498498
* __deploymentKey__ *(String)* - Specifies the deployment key you want to query for an update against. By default, this value is derived from the `Info.plist` file (iOS) and `MainActivity.java` file (Android), but this option allows you to override it from the script-side if you need to dynamically use a different deployment for a specific call to `sync`.
499499
500-
* __installMode__ *(codePush.InstallMode)* - Specifies when you would like to install optional updates (i.e. they aren't marked as mandatory). Defaults to `codePush.InstallMode.ON_NEXT_RESTART`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
500+
* __installMode__ *(codePush.InstallMode)* - Specifies when you would like to install optional updates (i.e. those not marked as mandatory). Defaults to `codePush.InstallMode.ON_NEXT_RESTART`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
501501
502502
* __mandatoryInstallMode__ *(codePush.InstallMode)* - Specifies when you would like to install updates which are marked as mandatory. Defaults to `codePush.InstallMode.IMMEDIATE`. Refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do.
503503
@@ -534,6 +534,10 @@ codePush.sync({ deploymentKey: "KEY" });
534534
// instead of waiting until the app is restarted
535535
codePush.sync({ installMode: codePush.InstallMode.ON_NEXT_RESUME });
536536
537+
// Download the update silently, and install optional updates
538+
// on the next restart, but install mandatory updates on the next resume.
539+
codePush.sync({ mandatoryInstallMode: codePush.InstallMode.ON_NEXT_RESUME });
540+
537541
// Changing the title displayed in the
538542
// confirmation dialog of an "active" update
539543
codePush.sync({ updateDialog: { title: "An update is available!" } });
@@ -633,7 +637,8 @@ The CodePush API includes the following enums which can be used to customize the
633637
##### InstallMode
634638
635639
This enum specified when you would like an installed update to actually be applied, and can be passed to either the `sync` or `LocalPackage.install` methods. It includes the following values:
636-
* __codePush.InstallMode.IMMEDIATE__ *(0)* - 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 would remove the latency between the update installation and the next time the end user restarts or resumes the app.
640+
641+
* __codePush.InstallMode.IMMEDIATE__ *(0)* - 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.
637642
638643
* __codePush.InstallMode.ON_NEXT_RESTART__ *(1)* - 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.
639644

0 commit comments

Comments
 (0)