You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -619,6 +619,7 @@ Contains details about an update that has been downloaded locally or already ins
619
619
- __packageSize__: The size of the code contained within the update, in bytes. *(Number)*
620
620
621
621
###### Methods
622
+
622
623
- __install(installMode: codePush.InstallMode = codePush.InstallMode.ON_NEXT_RESTART, minimumBackgroundDuration = 0): 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. The `installMode` parameter controls when the changes are actually presented to the end user. The default value is to wait until the next app restart to display the changes, but you can refer to the [`InstallMode`](#installmode) enum reference for a description of the available options and what they do. If the `installMode` parameter is set to `InstallMode.ON_NEXT_RESUME`, then the `minimumBackgroundDuration` parameter allows you to control how long the app must have been in the background before forcing the install after it is resumed.
623
624
624
625
##### RemotePackage
@@ -632,6 +633,7 @@ The `RemotePackage` inherits all of the same properties as the `LocalPackage`, b
632
633
-__downloadUrl__:TheURL at which the package is available for download. This property is only needed for advanced usage, since the `download` method will automatically handle the acquisition of updates for you. *(String)*
633
634
634
635
###### Methods
636
+
635
637
-__download(downloadProgressCallback?:Function): Promise<LocalPackage>__:Downloads the available update from the CodePush service. If a `downloadProgressCallback` is specified, it will be called periodically with a `DownloadProgress` object (`{ totalBytes: Number, receivedBytes: Number }`) that reports the progress of the download until it completes. Returns a Promise that resolves with the `LocalPackage`.
636
638
637
639
#### Enums
@@ -698,26 +700,24 @@ The Java API is made available by importing the `com.microsoft.codepush.react.Co
698
700
699
701
#### CodePush
700
702
701
-
Constructs the CodePush client runtime and includes methods for integrating CodePush into your app's `ReactInstanceManager`.
703
+
Constructs the CodePush client runtime and represents the `ReactPackage` instance that you add to you app's list of packages.
702
704
703
705
##### Constructors
704
706
705
-
-__CodePush(String deploymentKey, Activity mainActivity)__-Creates a new instance of the CodePush runtime, that will be used to query the service for updates via the provided deployment key. The`mainActivity` parameter should always be set to `this`when configuring your `ReactInstanceManager` inside the `MainActivity`class. This constructor puts the CodePush runtime into "release mode", so if you want to enable debugging behavior, use the following constructor instead.
707
+
-__CodePush(String deploymentKey, Activity mainActivity)__-Creates a new instance of the CodePush runtime, that will be used to query the service for updates via the provided deployment key. The`mainActivity` parameter should always be set to `this`when configuring your React packages list inside the `MainActivity`class. This constructor puts the CodePush runtime into "release mode", so if you want to enable debugging behavior, use the following constructor instead.
706
708
707
709
-__CodePush(String deploymentKey, Activity mainActivity, bool isDebugMode)__-Equivalent to the previous constructor, but allows you to specify whether you want the CodePush runtime to be in debug mode ornot. Whenusing this constructor, the `isDebugMode` parameter should always be set to `BuildConfig.DEBUG`in order to stay synchronized with your build type. When putting CodePush into debug mode, the following behaviors are enabled:
708
710
709
711
1. OldCodePush updates aren't deleted from storage whenever a new binary is deployed to the emulator/device. This behavior enables you to deploy new binaries, without bumping the version during development, and without continuously getting the same update every time your app calls `sync`.
710
712
711
713
2. The local cache that the React Native runtime maintains in debug mode is deleted whenever a CodePush update is installed. This ensures that when the app is restarted after an update is applied, you will see the expected changes. As soon as [this PR](https://github.com/facebook/react-native/pull/4738) is merged, we won't need to do this anymore.
712
714
713
-
##### Methods
715
+
##### Static Methods
714
716
715
717
-__getBundleUrl()__-Returns the path to the most recent version of your app's JS bundle file, assuming that the resource name is `index.android.bundle`. If your app is using a different bundle name, then use the overloaded version of this method which allows specifying it. This method has the same resolution behavior as the Objective-C equivalent described above.
716
718
717
719
- __getBundleUrl(String bundleName)__ - Returns the path to the most recent version of your app's JS bundle file, using the specified resource name (e.g. `index.android.bundle`). This method has the same resolution behavior as the Objective-C equivalent described above.
718
720
719
-
-__getReactPackage()__-Returns a `ReactPackage` object that should be added to your `ReactInstanceManager` via its `addPackage` method. Without this, the `react-native-code-push`JSmodule won't be available to your script.
720
-
721
721
## Example Apps
722
722
723
723
TheReactNative community has graciously created some awesome open source apps that can serve as examples for developers that are getting started. The following is a list of OSSReactNative apps that are also usingCodePush, and can therefore be used to see how others are using the service:
0 commit comments