1
具体推送通知我使用this PHP script发送通知到火力地堡:如何删除从API服务器
...
$fields = [
'to' => DEVICE_TOKEN,
'notification' => [
'title' => "Title",
'body' => 'notification body',
'tag' => 'tag',
],
];
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec($ch);
...
并正确弹出我的的Android。我也可以编辑通知使用tag
属性
但是如何删除通知?例如,如果有人在浏览器中阅读它,我需要从其他设备中删除此通知。
我试图在编辑的通知中发送空的body
,但不起作用。
在科尔多瓦前端我使用cordova-plugin-firebase,我不确定问题是在后端还是前端。