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
{{ message }}
This repository was archived by the owner on May 20, 2025. It is now read-only.
Queries the CodePush service to see whether the configured app deployment has an update available. By default, it will use the deployment key that is configured in your `Info.plist` file (iOS), or `MainActivity.java` file (Android), but you can override that by specifying a value via the optional `deploymentKey` parameter. This can be useful when you want to dynamically "redirect" a user to a specific deployment, such as allowing "early access" via an easter egg or a user setting switch.
186
186
187
+
Second optional parameter `handleBinaryVersionMismatchCallback` is an optional callback function that can be used to notify user if there are any binary update.
188
+
E.g. consider a use-case where currently installed binary version is 1.0.1 with label(codepush label) v1. Later native code was changed in the dev cycle and binary version was updated to 1.0.2. When code-push update check is triggered we ignore updates having binary version mismatch (because the update is not targeting to the binary version of currently installed app). In this case installed app (1.0.1) will ignore the update targeting version 1.0.2. You can use `handleBinaryVersionMismatchCallback` to provide a hook to handle such situations.
189
+
190
+
**NOTE:**
191
+
Be cautious to use Alerts within this callback if you are developing iOS application, due to [App Store](https://developer.apple.com/app-store/review/guidelines/) review process:
192
+
> Apps must not force users to rate the app, review the app, download other apps, or other similar actions in order to access functionality, content, or use of the app.
193
+
187
194
This method returns a `Promise` which resolves to one of two possible values:
188
195
189
196
1. `null` if there is no update available. This can occur in the following scenarios:
@@ -356,7 +363,7 @@ This method is for advanced scenarios, and is primarily useful when the followin
Synchronizes your app's JavaScript bundle and image assets with the latest release to the configured deployment. Unlike the [checkForUpdate](#codepushcheckforupdate) method, which simply checks for the presence of an update, and let's you control what to do next, `sync` handles the update check, download and installation experience for you.
@@ -429,7 +436,7 @@ codePush.sync({
429
436
});
430
437
```
431
438
432
-
In addition to the options, the `sync` method also accepts two optional function parameters which allow you to subscribe to the lifecycle of the `sync` "pipeline" in order to display additional UI as needed (e.g. a "checking for update modal or a download progress modal):
439
+
In addition to the options, the `sync` method also accepts several optional function parameters which allow you to subscribe to the lifecycle of the `sync` "pipeline" in order to display additional UI as needed (e.g. a "checking for update modal or a download progress modal):
433
440
434
441
* __syncStatusChangedCallback__ *((syncStatus:Number) =>void)*- Called when the sync process moves from one stage to another in the overall update process. The method is called with a status code which represents the current state, and can be any of the [`SyncStatus`](#syncstatus) values.
435
442
@@ -439,6 +446,9 @@ In addition to the options, the `sync` method also accepts two optional function
439
446
440
447
* __receivedBytes__ *(Number)*- The number of bytes downloaded thus far, which can be used to track download progress.
Called when there are any binary update available. The method is called with a [`RemotePackage`](#remotepackage) object. Refer to [codePush.checkForUpdate](#codepushcheckforupdate) section for more details.
* Retrieves the metadata for an installed update (e.g. description, mandatory).
@@ -283,8 +286,9 @@ declare namespace CodePush {
283
286
* @param options Options used to configure the end-user update experience (e.g. show an prompt?, install the update immediately?).
284
287
* @param syncStatusChangedCallback An optional callback that allows tracking the status of the sync operation, as opposed to simply checking the resolved state via the returned Promise.
285
288
* @param downloadProgressCallback An optional callback that allows tracking the progress of an update while it is being downloaded.
289
+
* @param handleBinaryVersionMismatchCallback An optional callback for handling target binary version mismatch
0 commit comments