HarmonyOS 应用上架后的建议更新和强制更新

看到我们sdk中有updateManager,可以检查版本和弹出更新弹窗。

想问下有没有强更相关配置,比如在应用市场上设置低于某个版本或者特定版本需强更

HarmonyOS
2025-01-10 09:07:43
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
aquaa

没有强制更新的配置,可以自行做弹框,通过业务判断,如果使用用户没有更新,就不让他继续使用

通过startAbility拉起应用市场app,传入应用appId跳转到指定应用界面

import Want from '@ohos.app.ability.Want';
import common from '@ohos.app.ability.common';

@Entry
@Component
struct Index {
  @State appId: string = 'C1142586279411547392';
  controller: TextInputController = new TextInputController();
  build() {
    Row() {
      Column() {
        TextInput({ text: this.appId, placeholder: '请输入应用的appId', controller: this.controller })
          .width('90%')
          .onChange((value: string) => {
            this.appId = value
          })
        Button('点击跳转到HarmonyOS版应用市场详情页面')
          .margin({top: 50})
          .onClick(()=>{
            const want: Want = {
              uri: store://appgallery.huawei.com/app/detail?id=${this.appId}
            };
            const context = getContext(this) as common.UIAbilityContext;
            context.startAbility(want).then(()=>{
              //拉起成功
            }).catch(()=>{
              // 拉起失败
            });
          })
      }
      .width('100%')
    }
    .height('100%')
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
分享
微博
QQ
微信
回复
2025-01-10 11:38:40
相关问题
鸿蒙版应用上疑问
6613浏览 • 1回复 待解决
HarmonyOS 应用上资质相关
1116浏览 • 1回复 待解决
HarmonyOS 应用上流程是怎样
645浏览 • 1回复 待解决
HarmonyOS 应用更新
658浏览 • 1回复 待解决
HarmonyOS 应用上一直loading
536浏览 • 1回复 待解决
使用华为账号DEMO需要应用上
1384浏览 • 1回复 待解决
HarmonyOS 应用版本更新
571浏览 • 1回复 待解决
HarmonyOS应用更新demo
792浏览 • 1回复 待解决
HarmonyOS应用升级更新
2360浏览 • 1回复 待解决
HarmonyOS 更新数据UI不刷新
751浏览 • 1回复 待解决