HarmonyOS 推送,点击进入应用首页数据,发送失败?

actionType为1,发送推送成功,手机可收到推送。

"actionType": 1,
"uri": "***://***.com/gallery/explore",
"data": {"testKey": "testValue"},
Success: {'code': '80000000', 'msg': 'Success', 'requestId': 'xxx'}

actionType为0,发送推送成功,手机未收到推送。

"actionType": 0,
"data": {"testKey": "testValue"},
Success: {'code': '80000000', 'msg': 'Success', 'requestId': 'xxx'}
阅读 438
1 个回答

项目模块级别下的src/main/module.json5文件中,待跳转Ability的skills标签下不可以同时配置actions和uris值。skills标签下可以同时存在多个skill对象,每个对象对应一种能力。若需要同时设置推送消息跳转能力和其他跳转能力(如NFC跳转、浏览器跳转等),需要在skills数组中创建不同的skill对象,分别映射对应的能力。https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/push-send-alert-V5\#section1792616175914

示例:

"skills": [
// 保持skills中原有的对象不变
{
  "entities": [
  "entity.system.home"
  ],
  "actions": [
  "action.system.home"
  ]
},
// 新增一个skill对象用于其它跳转
{
  "actions": [
  ""
  ],
  "uris": [
  {
    "scheme": "https",
  "host": "xxx",
  "port": "8080",
  "path": "push/test2"
  }
  ]
}
]
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进