react-native-code-push
Advanced tools
Comparing version 1.10.3-beta to 1.10.4-beta
{ | ||
"name": "react-native-code-push", | ||
"version": "1.10.3-beta", | ||
"version": "1.10.4-beta", | ||
"description": "React Native plugin for the CodePush service", | ||
@@ -5,0 +5,0 @@ "main": "CodePush.js", |
@@ -385,3 +385,3 @@ # React Native Module for CodePush | ||
* [notifyApplicationReady](#codepushnotifyapplicationready): Notifies the CodePush runtime that an installed update is considered successful. If you are manually checking for and installing updates (i.e. not using the [sync](#codepushsync) method to handle it all for you), then this method **MUST** be called; otherwise CodePush will treat the update as failed and rollback to the previous version when the app next restarts. | ||
* [notifyAppReady](#codepushnotifyappready): Notifies the CodePush runtime that an installed update is considered successful. If you are manually checking for and installing updates (i.e. not using the [sync](#codepushsync) method to handle it all for you), then this method **MUST** be called; otherwise CodePush will treat the update as failed and rollback to the previous version when the app next restarts. | ||
@@ -621,5 +621,7 @@ * [restartApp](#codepushrestartapp): Immediately restarts the app. If there is an update pending, it will be immediately displayed to the end user. Otherwise, calling this method simply has the same behavior as the end user killing and restarting the process. | ||
* __downloadProgressCallback__ *((progress: DownloadProgress) => void)* - Called periodically when an available update is being downloaded from the CodePush server. The method is called with a `DownloadProgress` object, which contains the following two properties: | ||
* __totalBytes__ *(Number)* - The total number of bytes expected to be received for this update package | ||
* __receivedBytes__ *(Number)* - The number of bytes downloaded thus far. | ||
* __totalBytes__ *(Number)* - The total number of bytes expected to be received for this update (i.e. the size of the set of files which changed from the previous release). | ||
* __receivedBytes__ *(Number)* - The number of bytes downloaded thus far, which can be used to track download progress. | ||
Example Usage: | ||
@@ -630,12 +632,17 @@ | ||
// and then display a "downloading" modal | ||
codePush.sync({ updateDialog: true }, (status) => { | ||
switch (status) { | ||
case codePush.SyncStatus.DOWNLOADING_PACKAGE: | ||
// Show "downloading" modal | ||
break; | ||
case codePush.SyncStatus.INSTALLING_UPDATE: | ||
// Hide "downloading" modal | ||
break; | ||
} | ||
}); | ||
codePush.sync({ updateDialog: true }, | ||
(status) => { | ||
switch (status) { | ||
case codePush.SyncStatus.DOWNLOADING_PACKAGE: | ||
// Show "downloading" modal | ||
break; | ||
case codePush.SyncStatus.INSTALLING_UPDATE: | ||
// Hide "downloading" modal | ||
break; | ||
} | ||
}, | ||
(totalBytes, receivedBytes) => { | ||
/* Update download modal progress */ | ||
} | ||
); | ||
``` | ||
@@ -642,0 +649,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
758714
2558
832