Commit 2e90adff by wong.peiyi

修改热更新提示策略

parent b7c69c78
Showing with 27 additions and 4 deletions
...@@ -29,8 +29,6 @@ const codepushOptions = { ...@@ -29,8 +29,6 @@ const codepushOptions = {
// ON_APP_START 开机时检测 // ON_APP_START 开机时检测
// MANUAL 手动 // MANUAL 手动
checkFrequency: CodePush.CheckFrequency.ON_APP_RESUME, checkFrequency: CodePush.CheckFrequency.ON_APP_RESUME,
installMode: CodePush.InstallMode.ON_NEXT_RESTART,
updateDialog: false,
} }
class App extends Component { class App extends Component {
...@@ -45,7 +43,32 @@ class App extends Component { ...@@ -45,7 +43,32 @@ class App extends Component {
} }
syncImmediate() { syncImmediate() {
CodePush.sync({}) CodePush.sync({
//安装模式
//ON_NEXT_RESUME 下次恢复到前台时
//ON_NEXT_RESTART 下一次重启时
//IMMEDIATE 马上更新
installMode : CodePush.InstallMode.IMMEDIATE ,
//对话框
updateDialog : {
//是否显示更新描述
appendReleaseDescription : false ,
//更新描述的前缀。 默认为"Description"
descriptionPrefix : "更新内容:" ,
//强制更新按钮文字,默认为continue
mandatoryContinueButtonLabel : "立即更新" ,
//强制更新时的信息. 默认为"An update is available that must be installed."
mandatoryUpdateMessage : "必须更新后才能使用" ,
//非强制更新时,按钮文字,默认为"ignore"
optionalIgnoreButtonLabel : '稍后' ,
//非强制更新时,确认按钮文字. 默认为"Install"
optionalInstallButtonLabel : '后台更新' ,
//非强制更新时,检查到更新的消息文本
optionalUpdateMessage : '有新版本了,是否更新?',
//Alert窗口的标题
title : '更新提示'
}
})
} }
render() { render() {
......
{ {
"name": "BoneHouse_Business_APP", "name": "BoneHouse_Business_APP",
"version": "1.2.6", "version": "1.2.5",
"private": true, "private": true,
"scripts": { "scripts": {
"postinstall": "npx jetify", "postinstall": "npx jetify",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment