HarmonyOS webview拉起应用

webview是否支持window.location.href = 'store://appgallery.huawei.com/app的方式拉起应用。

HarmonyOS
2024-09-04 11:44:49
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Heiang

直接通过window.location.href = 'store://appgallery.huawei.com/app不行,但可以web拦截后拉起

Web({ src: $rawfile('call.html'), controller: this.controller }) 
  .onLoadIntercept((event) => { 
    if (event) { 
      let url: string = event.data.getRequestUrl(); 
      if (url.indexOf('store://') === 0) { 
        const want: Want = { 
          uri: `store://appgallery.huawei.com/app` 
        } 
        const context = getContext(this) as common.UIAbilityContext; 
        context.startAbility(want).then(() => { 
        }).catch(() => { 
        }) 
        return true; 
      } 
    } 
    return false; 
  })
分享
微博
QQ
微信
回复
2024-09-04 18:16:54
相关问题
HarmonyOS 如何拉起相机应用
1009浏览 • 1回复 待解决
HarmonyOS 如何拉起应用市场?
1347浏览 • 1回复 待解决
HarmonyOS 通过https地址拉起应用
773浏览 • 1回复 待解决
如何拉起应用市场界面
4298浏览 • 1回复 待解决
HarmonyOS 元服务无法拉起应用
1000浏览 • 1回复 待解决
HarmonyOS 应用拉起系统录音机
1947浏览 • 1回复 待解决
HarmonyOS 应用如何跳转拉起第三方应用
1240浏览 • 1回复 待解决
如何拉起设置应用的主界面?
1720浏览 • 2回复 待解决
框架是否能够拉起应用APP
4326浏览 • 2回复 待解决
如何拉起设置应用的主界面
2793浏览 • 1回复 待解决
如何拉起设置应用的常用界面
2938浏览 • 0回复 待解决
浏览器应用应该怎样拉起
1667浏览 • 2回复 待解决
HarmonyOS H5网页如何拉起HarmonyOS 应用
1182浏览 • 1回复 待解决