对于skills中的actions与uris在实践中发现是其他应用打开应用时对应的参数。
let want: Want = {
// uri: "xxxxx"
action: "xxx"
}
但是在推送中发现这两个字段随便传都能唤起应用。
{
"payload": {
"notification": {
"category": "MARKETING",
"title": "普通标题",
"body": "普通内容",
"clickAction": {
"actionType": 1,
"action": "actions", // 这里的 action 是随便写的
"data": {
"testKey": "testValue"
}
},
"style": 0
}
},
"target": {
"token": [
"xxx"
]
},
"pushOptions": {
"testMessage": true
}
}
文档上面也没说要对应 https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/push-send-alert-V5\#section1792616175914,只是说在onCreate和onNewWant中处理逻辑。是否这个字段在推送场景下与module.json5中skills无强关联?
action字段为应用内置页面ability对应的action。当actionType为1时,字段uri和action至少填写一个。
action如何设置请参见:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/push-send-alert-V5\#section8794131614597