HarmonyOS 是否支持从App跳转到应用市场的App主页

HarmonyOS
2024-12-25 10:24:02
1655浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
put_get

参考示例如下:

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

@Entry
@Component
struct Index {
  @State appId: string = 'appId';
  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.
  • 36.
分享
微博
QQ
微信
回复
2024-12-25 13:44:37


相关问题
如何跳转到应用市场app下载页面?
8930浏览 • 1回复 待解决
如何app跳转到系统相机
6468浏览 • 1回复 已解决
怎么跳转打开系统应用市场app
3720浏览 • 1回复 待解决
鸿蒙APP如何跳转到Android APP
16464浏览 • 3回复 待解决
HarmonyOS 怎么跳转到华为应用市场
1041浏览 • 1回复 待解决
怎样才能跳转到应用市场界面?
2042浏览 • 2回复 待解决
HarmonyOS app中怎么跳转到系统设置?
1303浏览 • 1回复 待解决
HarmonyOS applink浏览器跳转到应用
1310浏览 • 1回复 待解决
HarmonyOS 在H5中如何跳转到应用市场
1795浏览 • 1回复 待解决