react-native-code-push
Advanced tools
Comparing version 1.8.0-beta to 1.9.0-beta
@@ -242,2 +242,3 @@ import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk"; | ||
mandatoryInstallMode: CodePush.InstallMode.IMMEDIATE, | ||
minimumBackgroundDuration: 0, | ||
updateDialog: null, | ||
@@ -277,3 +278,7 @@ ...options | ||
} else { | ||
log("Update is installed and will be run when the app next resumes."); | ||
if (syncOptions.minimumBackgroundDuration > 0) { | ||
log(`Update is installed and will be run after the app has been in the background for at least ${syncOptions.minimumBackgroundDuration} seconds.`); | ||
} else { | ||
log("Update is installed and will be run when the app next resumes."); | ||
} | ||
} | ||
@@ -307,3 +312,3 @@ break; | ||
syncStatusChangeCallback(CodePush.SyncStatus.INSTALLING_UPDATE); | ||
await localPackage.install(resolvedInstallMode, () => { | ||
await localPackage.install(resolvedInstallMode, syncOptions.minimumBackgroundDuration, () => { | ||
syncStatusChangeCallback(CodePush.SyncStatus.UPDATE_INSTALLED); | ||
@@ -310,0 +315,0 @@ }); |
@@ -40,5 +40,5 @@ import { AcquisitionManager as Sdk } from "code-push/script/acquisition-sdk"; | ||
const local = { | ||
async install(installMode = NativeCodePush.codePushInstallModeOnNextRestart, updateInstalledCallback) { | ||
async install(installMode = NativeCodePush.codePushInstallModeOnNextRestart, minimumBackgroundDuration = 0, updateInstalledCallback) { | ||
const localPackage = this; | ||
await NativeCodePush.installUpdate(this, installMode); | ||
await NativeCodePush.installUpdate(this, installMode, minimumBackgroundDuration); | ||
updateInstalledCallback && updateInstalledCallback(); | ||
@@ -45,0 +45,0 @@ if (installMode == NativeCodePush.codePushInstallModeImmediate) { |
{ | ||
"name": "react-native-code-push", | ||
"version": "1.8.0-beta", | ||
"version": "1.9.0-beta", | ||
"description": "React Native plugin for the CodePush service", | ||
@@ -19,3 +19,3 @@ "main": "CodePush.js", | ||
"dependencies": { | ||
"code-push": "1.5.2-beta" | ||
"code-push": "1.8.0-beta" | ||
}, | ||
@@ -22,0 +22,0 @@ "devDependencies": { |
@@ -28,4 +28,5 @@ // Type definitions for React Native CodePush pligin. | ||
* @param installMode Indicates when you would like the update changes to take affect for the end-user. | ||
* @param minimumBackgroundDuration For resume-based installs, this specifies the number of seconds the app needs to be in the background before forcing a restart. Defaults to 0 if unspecified. | ||
*/ | ||
install(installMode: CodePush.InstallMode): ReactNativePromise<void>; | ||
install(installMode: CodePush.InstallMode, minimumBackgroundDuration?: number): ReactNativePromise<void>; | ||
} | ||
@@ -110,4 +111,4 @@ | ||
/** | ||
* Indicates when you would like to "install" the update after downloading it, which includes reloading the JS bundle in order for | ||
* any changes to take affect. Defaults to codePush.InstallMode.ON_NEXT_RESTART. | ||
* Specifies when you would like to install optional updates (i.e. those that aren't marked as mandatory). | ||
* Defaults to codePush.InstallMode.ON_NEXT_RESTART. | ||
*/ | ||
@@ -117,2 +118,16 @@ installMode?: CodePush.InstallMode; | ||
/** | ||
* Specifies when you would like to install updates which are marked as mandatory. | ||
* Defaults to codePush.InstallMode.IMMEDIATE. | ||
*/ | ||
mandatoryInstallMode?: CodePush.InstallMode; | ||
/** | ||
* Specifies the minimum number of seconds that the app needs to have been in the background before restarting the app. This property | ||
* only applies to updates which are installed using `InstallMode.ON_NEXT_RESUME`, and can be useful for getting your update in front | ||
* of end users sooner, without being too obtrusive. Defaults to `0`, which has the effect of applying the update immediately after a | ||
* resume, regardless how long it was in the background. | ||
*/ | ||
minimumBackgroundDuration?: number; | ||
/** | ||
* An "options" object used to determine whether a confirmation dialog should be displayed to the end user when an update is available, | ||
@@ -119,0 +134,0 @@ * and if so, what strings to use. Defaults to null, which has the effect of disabling the dialog completely. Setting this to any truthy |
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
752245
84
2446
842
+ Addedasync@1.5.2(transitive)
+ Addedcode-push@1.8.0-beta(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcomponent-emitter@1.2.1(transitive)
+ Addedcookiejar@2.0.6(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedextend@3.0.0(transitive)
+ Addedform-data@1.0.0-rc3(transitive)
+ Addedformidable@1.0.17(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.3.4(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.0.0(transitive)
+ Addedqs@2.3.3(transitive)
+ Addedreadable-stream@1.0.27-1(transitive)
+ Addedreduce-component@1.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
+ Addedsuperagent@1.8.5(transitive)
- Removedcode-push@1.5.2-beta(transitive)
- Removedfs@0.0.2(transitive)
- Removedtry-json@1.0.1(transitive)
Updatedcode-push@1.8.0-beta