HarmonyOS push推送跟Uris配置冲突问题

项目中的module.json5文件中配置了actions和Uris,配置如下:

"abilities": [
{"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:splash_center_img",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"orientation": "unspecified",
"skills": [
  {
    "entities": [
    "entity.system.home",
    "entity.system.browsable"
    ],
    "actions": [
    "action.system.home",
    "ohos.want.action.viewData",
    "ohos.nfc.tag.action.TAG_FOUND"
    ],
    "uris": [{
    "scheme": 'bocom',
  },{
    "scheme": 'https',
    "host": "xxx"
  },{
    "scheme": 'https',
    "host": "xxx"
  }],
    "domainVerify": true
  }
  ],
}
],
  • 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.

配置完之后,导致push的内容收不到。

HarmonyOS
2024-12-25 17:31:42
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
put_get

push点击消息进入应用内页并传递数据配置可以查看下面的链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/push-send-alert-V5#section8794131614597push的skills与其他的skills冲突,导致push消息收不到,可以参考下面的示例:

"skills": [
{
  "entities": [
  "entity.system.home",
  "entity.system.browsable"
  ],
  "actions": [
  "action.system.home",
  "ohos.want.action.viewData",
  "ohos.nfc.tag.action.TAG_FOUND"
  ],
  "uris": [{
  "scheme": 'bocom',
},{
  "scheme": 'https',
  "host": "mbanktest.95559.com.cn"
},{
  "scheme": 'https',
  "host": "download1.bankcomm.com"
}],
  "domainVerify": true
},
{// 设置actions参数完成点击消息进入应用内页示例(若skills中添加了uris参数,则uris内容需为空)
  "actions": [
  "com.test.action"
  ]
},
{// 设置uris参数完成点击消息进入应用内页示例(skills中必须同时设置actions参数,actions参数为空)
  "actions": [""],
  "uris": [
  {
    "scheme": "https",
  "host": "www.test.com",
  "port": "8080",
  "path": "push/test"
  }
  ]
}
]
  • 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.
  • 37.
  • 38.
  • 39.

上面给出的示例是针对应用内的消息跳转的示例,actionType是1,如果这边需要同时支持跳转到首页,可以将entity.system.home的skill抽出来,比如:

"skills": [
{ //进入应用首页
  "entities": [
  "entity.system.home",
  ],
  "actions": [
  "action.system.home",
  ]
},
{ //配置AppLink
  "entities": [
  "entity.system.browsable"
  ],
  "actions": [
  "ohos.want.action.viewData",
  "ohos.nfc.tag.action.TAG_FOUND"
  ],
  "uris": [{
  "scheme": 'bocom',
},{
  "scheme": 'https',
  "host": "xxx"
},{
  "scheme": 'https',
  "host": "xxx"
}],
  "domainVerify": true
},
{// 设置actions参数完成点击消息进入应用内页示例(若skills中添加了uris参数,则uris内容需为空)
  "actions": [
  "action.ohos.push.listener"
  ]
},
  • 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.
分享
微博
QQ
微信
回复
2024-12-25 19:56:41


相关问题
HarmonyOS JPUSH推送服务问题Push Kit)
783浏览 • 1回复 待解决
HarmonyOS PUSH推送右上角红点问题
683浏览 • 2回复 待解决
HarmonyOS 华为push和个推push推送效果
736浏览 • 1回复 待解决
HarmonyOS 无法获取推送Push Token
1080浏览 • 1回复 待解决
鸿蒙消息推送Push Kit
1030浏览 • 0回复 待解决
HarmonyOS push的skills与applink的skills冲突
552浏览 • 1回复 待解决
如何获取推送服务push token
1120浏览 • 1回复 待解决
HarmonyOS Push Kit收不到推送消息了
1506浏览 • 1回复 待解决
HarmonyOS 关于给自己的app推送push
885浏览 • 1回复 待解决
HarmonyOS 推送和uri配置
1161浏览 • 1回复 待解决
HarmonyOS 滑动冲突问题
1322浏览 • 1回复 待解决
HarmonyOS 推送配置的回执怎么设置
628浏览 • 1回复 待解决
HarmonyOS推送问题
625浏览 • 1回复 待解决