diff --git a/Examples/CodePushDemoApp/crossplatformdemo.js b/Examples/CodePushDemoApp/crossplatformdemo.js index 7111d1c..d9cc352 100644 --- a/Examples/CodePushDemoApp/crossplatformdemo.js +++ b/Examples/CodePushDemoApp/crossplatformdemo.js @@ -19,8 +19,7 @@ let CodePushDemoApp = React.createClass({ try { return await CodePush.sync( { - updateDialog: true, - installMode: CodePush.InstallMode.ON_NEXT_RESUME + installMode: CodePush.InstallMode.ON_NEXT_RESTART_OPPORTUNITY, }, (syncStatus) => { switch(syncStatus) { @@ -89,6 +88,15 @@ let CodePushDemoApp = React.createClass({ return { }; }, + toggleAllowRestart() { + if (CodePush.restartAllowed()) { + CodePush.disallowRestart(); + } else { + CodePush.allowRestart(); + } + this.forceUpdate(); + }, + render() { let syncView, syncButton, progressView; @@ -119,6 +127,9 @@ let CodePushDemoApp = React.createClass({ {syncView} {progressView} + ); }