HarmonyO AppLinking配置不生效,无法直接跳转至应用

Demo应用中appLinkingOnly设置为true,想直接唤起应用,提示错误码:"code":16000019。但是使用 let link: string = "https://saas.matetrip.cn/?from=failed";却可以跳转至这个应用。

Demo应用代码:

import measure  from '@ohos.measure'
import window from '@ohos.window';

@Entry
@Component
struct MeasureDemo {
  @State message: string = 'Hello World';
  private scrollerForList: Scroller = new Scroller()
  private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  @State measure: SizeOptions = measure.measureTextSize({
    textContent: this.message,
  })

  build() {Button('AppLink https')
    .margin({top: 10})
    .onClick(()=>{
      let context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext;
      let link: string = "xxxxxx";
      // 仅以App Linking的方式打开应用
      context.openLink(link, { appLinkingOnly: true })
        .then(() => {
          console.info('openlink success.');
        })
        .catch((error: BusinessError) => {
          console.error(`openlink failed. error:${JSON.stringify(error)}`);
        });
    })

AppLinking配置代码:

{
  "entities": [
  "entity.system.browsable"
  ],
  "actions": [
  "ohos.want.action.viewData"
  ],
  "uris": [
  {
    "scheme": "cmblife"
  },
  {
    "scheme": "http",
  "host": "cmbt.cn",
  "pathStartWith": "c/"
  },
  {
    "scheme": "https",
  "host": "cmbt.cn",
  "pathStartWith": "c/"
  },
  {
    "scheme": "https",
  "host": "open.cmbchina.com",
  "pathStartWith": "dispatch/"
  },
  {
    "scheme": "https",
  "host": "sandbox.cdcc.cmbchina.com",
  "pathStartWith": "dispatch/"
  }
  ],
  // domainVerify须设置为true
  "domainVerify": true
}

{
  "entities": [
  "entity.system.browsable"
  ],
  "actions": [
  "ohos.want.action.viewData"
  ],
  "uris": [
  {
    "scheme": "cmblife"
  },
  {
    "scheme": "http",
  "host": "cmbt.cn",
  "pathStartWith": "c/"
  },
  {
    "scheme": "https",
  "host": "cmbt.cn",
  "pathStartWith": "c/"
  },
  {
    "scheme": "https",
  "host": "xxxx",
  "pathStartWith": "dispatch/"
  },
  {
    "scheme": "https",
  "host": "xxxx",
  "pathStartWith": "dispatch/"
  }
  ],
  // domainVerify须设置为true
  "domainVerify": true
}
HarmonyOS
3天前
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
aquaa
分享
微博
QQ
微信
回复
3天前
相关问题
abiFilters配置生效
473浏览 • 1回复 待解决
求鸿蒙应用跳转至应用商店的方式?
3955浏览 • 1回复 待解决
求大佬告知如何跳转至应用市场
739浏览 • 0回复 待解决
HarmonyOS 编译器配置生效
490浏览 • 1回复 待解决
点击服务卡片如何跳转至指定的页面
2297浏览 • 1回复 待解决
HarmonyOS margin生效
658浏览 • 1回复 待解决
HarmonyOS expandSafeArea生效
342浏览 • 1回复 待解决
ConstraintSize尺寸设置生效
2412浏览 • 1回复 待解决
HarmonyOS @Observed生效问题
484浏览 • 1回复 待解决
HarmonyOS margin生效问题
108浏览 • 1回复 待解决
容器组件onVisibleAreaChange生效
1908浏览 • 1回复 待解决