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.
ON_NEXT_RESTART: NativeCodePush.codePushInstallModeOnNextRestart,// Don't artificially restart the app. Allow the update to be "picked up" on the next app restart
251
272
ON_NEXT_RESUME: NativeCodePush.codePushInstallModeOnNextResume// Restart the app the next time it is resumed from the background
252
273
},
253
-
SyncResult: {
254
-
UP_TO_DATE: 0,// The running app is up-to-date
255
-
UPDATE_IGNORED: 1,// The app had an optional update and the end-user chose to ignore it
256
-
UPDATE_INSTALLED: 2// The app had an optional/mandatory update that was successfully downloaded and is about to be installed.
257
-
},
258
274
SyncStatus: {
259
275
CHECKING_FOR_UPDATE: 0,
260
276
AWAITING_USER_ACTION: 1,
261
277
DOWNLOADING_PACKAGE: 2,
262
278
INSTALLING_UPDATE: 3,
263
-
IDLE: 4
279
+
UP_TO_DATE: 4,// The running app is up-to-date
280
+
UPDATE_IGNORED: 5,// The app had an optional update and the end-user chose to ignore it
281
+
UPDATE_INSTALLED: 6,// The app had an optional/mandatory update that was successfully downloaded and is about to be installed.
Provides a simple option for checking for an update, displaying a notification to the user, downloading it and then installing it, all while also respecting the policy that your release was published with. This method effectively composes together the "advanced mode" APIs for you, so that you don't need to handle any of the following scenarios yourself:
@@ -204,22 +204,25 @@ The method accepts an options object that allows you to customize numerous aspec
204
204
205
205
In addition, the method also recieves two function arguments which serve as event handlers which are called at various points in the sync process:
206
206
207
-
* __onSyncStatusChange__ (function(syncStatus: Number)) - Called when the sync process moves to a different step. Below is the list of possible SyncStatus values:
207
+
* __syncStatusChangeCallback__ (function(syncStatus: Number)) - Called when the sync process moves to a different step. Below is the list of possible SyncStatus values:
208
208
* __CodePush.SyncStatus.CHECKING_FOR_UPDATE__ *(0)* - Querying the CodePush server for an update.
209
209
* __CodePush.SyncStatus.AWAITING_USER_ACTION__ *(1)* - Waiting for a response from the user (e.g. a confirmation dialog).
210
210
* __CodePush.SyncStatus.DOWNLOADING_PACKAGE__ *(2)* - Downloading the updated package from the CodePush server.
211
-
* __CodePush.SyncStatus.INSTALLING_UPDATE__ *(3)* - Installing the downloaded update package.
212
-
* __CodePush.SyncStatus.IDLE__ *(4)* - The sync process has exited and is now idling.
211
+
* __CodePush.SyncStatus.INSTALLING_UPDATE__ *(3)* - The app had an optional or mandatory update that was successfully downloaded and is about to be installed.
212
+
* __CodePush.SyncStatus.UP_TO_DATE__ *(4)* - The app does not have an available update.
213
+
* __CodePush.SyncStatus.UPDATE_IGNORED__ *(5)* - The app has an optional update, that the user chose to ignore.
214
+
* __CodePush.SyncStatus.UPDATE_INSTALLED__ *(6)* - The update has been installed and will be run the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
215
+
* __CodePush.SyncStatus.UNKNOWN_ERROR__ *(-1)* - The sync operation encountered an unknown error.
213
216
214
-
* __onDownloadProgress__ (function(progress: DownloadProgress)) - Called periodically when the update package is being downloaded from the CodePush server to report the progress of the update. `DownloadProgress` contains two fields:
217
+
* __downloadProgressCallback__ (function(progress: DownloadProgress)) - Called periodically when the update package is being downloaded from the CodePush server to report the progress of the update. `DownloadProgress` contains two fields:
215
218
* __totalBytes__ (Number) - The total number of bytes expected to be received for this update package
216
219
* __receivedBytes__ (Number) - The number of bytes downloaded thus far.
217
220
218
-
The method returns a `Promise` that is resolved to a `SyncResult` integer code, which indicates why the `sync` call succeeded. This code can be one of the following values:
221
+
The method returns a `Promise` that is resolved to a `SyncStatus` integer code, which indicates why the `sync` call succeeded. This code can be one of the following values:
219
222
220
-
* __CodePush.SyncResult.UP_TO_DATE__ *(0)* - The app doesn't have an available update.
221
-
* __CodePush.SyncResult.UPDATE_IGNORED__ *(1)* - The app has an optional update, that the user chose to ignore.
222
-
* __CodePush.SyncResult.UPDATE_INSTALLED__ *(2)* - The app had an optional or mandatory update that was successfully downloaded and is about to be installed. If your app needs to do any data persistence/migration before restarting, this is the time to do it.
223
+
* __CodePush.SyncStatus.UP_TO_DATE__ *(4)* - The app does not have an available update.
224
+
* __CodePush.SyncStatus.UPDATE_IGNORED__ *(5)* - The app has an optional update, that the user chose to ignore.
225
+
* __CodePush.SyncStatus.UPDATE_INSTALLED__ *(6)* - The update has been installed and will be run the next time the app resumes/restarts, depending on the `InstallMode` specified in `SyncOptions`.
223
226
224
227
If the update check and/or the subseqeuent download fails for any reason, the `Promise` object returned by `sync` will be rejected with the reason.
0 commit comments