mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-10 15:49:36 +08:00
change UPDATE_INSTALLED behaviour
This commit is contained in:
@@ -62,4 +62,5 @@ var styles = StyleSheet.create({
|
||||
}
|
||||
});
|
||||
|
||||
CodePushDemoApp.displayName = 'CodePushDemoApp';
|
||||
AppRegistry.registerComponent('CodePushDemoApp', () => CodePushDemoApp);
|
||||
|
||||
@@ -5,6 +5,7 @@ var CodePushSdk = require('react-native-code-push');
|
||||
var NativeBridge = require('react-native').NativeModules.CodePush;
|
||||
|
||||
var {
|
||||
AppRegistry,
|
||||
Text,
|
||||
View,
|
||||
} = React;
|
||||
@@ -39,7 +40,10 @@ var DownloadAndInstallUpdateTest = React.createClass({
|
||||
runTest() {
|
||||
var update = require("./TestPackage");
|
||||
NativeBridge.downloadUpdate(update).done((downloadedPackage) => {
|
||||
NativeBridge.installUpdate(downloadedPackage, /*rollbackTimeout*/ 1000, CodePushSdk.InstallMode.IMMEDIATE);
|
||||
NativeBridge.installUpdate(downloadedPackage, /*rollbackTimeout*/ 1000, CodePushSdk.InstallMode.IMMEDIATE)
|
||||
.then(() => {
|
||||
NativeBridge.restartApp(/*rollbackTimeout*/ 1000);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -56,5 +60,6 @@ var DownloadAndInstallUpdateTest = React.createClass({
|
||||
});
|
||||
|
||||
DownloadAndInstallUpdateTest.displayName = 'DownloadAndInstallUpdateTest';
|
||||
AppRegistry.registerComponent('CodePushDemoApp', () => DownloadAndInstallUpdateTest);
|
||||
|
||||
module.exports = DownloadAndInstallUpdateTest;
|
||||
Reference in New Issue
Block a user