Ionic推送通知操作按钮未显示



我使用带有推送插件的ionic4来通过FCM发送推送通知。

我可以发送通知,但由于某些原因,操作按钮没有显示在通知中,只显示标题和正文内容。

以下是我请求的有效载荷:

{
"to": "eoD5PLNgj3A:APA91bHcrWcEfbEQuKGOozPXtIxO7CrN2Gd993bXcaaHSO8BkOXhwJ4x1o-7SIUEzIUVLxSwcKih1ac0jOkj4Jp8LQZkRiAHAEfRvRGopSAP4JkJVKXoRllxSkAUCAxWGCfUTk3umMsn",
"registration_ids": null,
"condition": null,
"collapse_key": null,
"content_available": null,
"mutable_content": null,
"priority": "high",
"time_to_live": 900,
"dry_run": false,
"data": {
"title": "New Visitor",
"message": "Suda Sankara Rao is here to see you at Protoco HQ.rn",
"visit_id": "ae866080-b6af-44cd-944c-6491ae9d2e4b",
"force-start": 1,
"visibility": 1,
"notId": "ae866080-b6af-44cd-944c-6491ae9d2e4b",
"actions": [{
"icon": "snooze",
"title": "Accept",
"callback": "visit.accept",
"foreground": false
}, {
"icon": "snooze",
"title": "Reject",
"callback": "visit.reject",
"foreground": true
}]
},
"notification": {
"title": "New Visitor",
"body": "Suda Sankara Rao is here to see you at Protoco HQ.rn",
"click_action": "visit",
"badge": null,
"android_channel_id": null,
"icon": null,
"sound": null,
"tag": "ae866080-b6af-44cd-944c-6491ae9d2e4b",
"color": null,
"body_loc_key": null,
"body_loc_args": null,
"title_loc_key": null,
"title_loc_args": null
}
}

接收以下格式的通知数据到设备:

{
"title": "New Visitor",
"message": "Suda Sankara Rao is here to see you at Protoco HQ.",
"additionalData": {
"actions": [{
"callback": "accept",
"foreground": false,
"title": "Accept"
}, {
"callback": "reject",
"foreground": true,
"title": "Reject"
}],
"visit_id": "ae866080-b6af-44cd-944c-6491ae9d2e4b",
"coldstart": false,
"foreground": true
}
}

离子信息:

Ionic:
Ionic CLI                     : 5.4.15 (/usr/local/lib/node_modules/ionic)
Ionic Framework               : @ionic/angular 4.11.8
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics    : 8.1.3
@angular/cli                  : 8.1.3
@ionic/angular-toolkit        : 2.1.2
Cordova:
Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 9 other plugins)

推送插件版本:phonegap-plugin-push@2.3.0

我搞不清楚这个问题。

我正在使用安卓模拟器来测试通知。

我可以识别并解决这个问题。

如果有效载荷具有CCD_ 2对象。操作按钮不可见。

我已经离开了,工作得很好。

最新更新