diff --git a/App.js b/App.js index 1e97365..79a44c3 100644 --- a/App.js +++ b/App.js @@ -121,7 +121,7 @@ async codePushUpdate() { this.codePushStatusDidChange.bind(this), this.codePushDownloadDidProgress.bind(this) ).then((status: SyncStatus) => { - + console.warn(status); }, (error: any) => { CodePush.restartApp(); }); @@ -132,28 +132,36 @@ async codePushUpdate() { codePushStatusDidChange(syncStatus) { switch(syncStatus) { case CodePush.SyncStatus.CHECKING_FOR_UPDATE: + console.warn("检查更新"); this.setState({ syncMessage: "检查更新" }); break; case CodePush.SyncStatus.DOWNLOADING_PACKAGE: + console.warn("下载更新"); this.setState({ syncMessage: "下载更新" }); break; case CodePush.SyncStatus.AWAITING_USER_ACTION: + console.warn("等待用户操作"); this.setState({ syncMessage: "等待用户操作" }); break; case CodePush.SyncStatus.INSTALLING_UPDATE: + console.warn("安装更新"); this.setState({ syncMessage: "安装更新" }); break; case CodePush.SyncStatus.UP_TO_DATE: + console.warn("已更新到最新程序"); this.setState({ syncMessage: "已更新到最新程序", updating: false }); break; case CodePush.SyncStatus.UPDATE_IGNORED: + console.warn("更新被取消"); this.setState({ syncMessage: "更新被取消", updating: false }); break; case CodePush.SyncStatus.UPDATE_INSTALLED: + console.warn("更新已安装,重启应用后生效"); this.setState({ syncMessage: "更新已安装,重启应用后生效", updating: false }); CodePush.restartApp(); break; case CodePush.SyncStatus.UNKNOWN_ERROR: + console.warn("未知错误"); this.setState({ syncMessage: "未知错误", updating: false }); break; }