可参考:{ "module": { "name": "entry", "type": "entry", "description": "$string:module_desc", "mainElement": "EntryAbility", "deviceTypes": [ "phone", "2in1" ], "metadata": [ { "name": "client_id", "value": "109834877" } ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { "name": "EntryAbility", "srcEntry": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:icon_json", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:icon_json", "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ // applink 的skills { "entities": [ "entity.system.home", "entity.system.browsable" ], "actions": [ "action.system.home", "ohos.want.action.viewData" ], "uris": [ { "scheme": "sohunews", "host": "pr", }, { "scheme": "https", "host": "test3g.k.sohu.com", } ], // domainVerify须设置为true "domainVerify": true }, // push 的skills 设置uris参数完成点击消息进入应用内页示例 // 设置完成后需要https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/push-send-alert-V5#section8794131614597 参照2 配置对应的clickAction { "actions": ["com.test.action"], } ] } ], "requestPermissions": [ { "name": "ohos.permission.GET_BUNDLE_INFO" }, { "name": "ohos.permission.INTERNET" } ] } } // Request Body { "payload": { "notification": { "category": "MARKETING", "title": "普通通知标题", "body": "普通通知内容", "clickAction": { "actionType": 1, "action": "com.test.action" "data": {"uri":"news://newsId=804516881&channelId=0&isfrompush=1&msgId=1337367441&pushType=4&bucket=1001&group=group_last&cfrFrom=4&layers=1_1_5_9_4_3&titleIndex=0"} } } }, "target": { "token": ["xxxxx"] }, "pushOptions": { "testMessage": true }}然后覆写 onCreat 与onNewWant方法 处理data数据
可参考:
然后覆写 onCreat 与onNewWant方法 处理data数据