From 54a4b19998ddc6502f41d0a1285a637f51b797ae Mon Sep 17 00:00:00 2001 From: hupeng Date: Mon, 5 Aug 2019 16:35:42 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=87=E7=BA=A7][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=87=E7=BA=A7=E7=BB=84=E4=BB=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; }