FCM-收到新的推送通知时,删除旧的推送通知磁贴 [英] FCM - Remove Older Push Notifcation Tiles when a new Push Notiifcation is recieved
问题描述
我已经以Xamarin形式实施了FCM,并且按预期工作.但是我想在收到新的推送时从通知托盘中删除所有通知.
I have implemented FCM in Xamarin Forms and is working as expected. But I want to removed all the notifications from the notification tray when a new push is received.
我尝试使用相同的crash_key,但是收到了所有消息,而不是最近的推送.
I have tried using the same collapse_key, but all the messages are received instead of the recent push.
有人可以帮我吗?
推荐答案
您应继续使用tag
参数,并记住该参数应位于notification
有效负载中,而不应位于data
中(自定义键值对)有效负载.
You should proceed with using the tag
parameter, keeping in mind that it should be in the notification
payload, not in the data
(custom key-value pair) payload.
如果您使用Firebase Notification Console发送消息,则将无法在其中设置tag
参数.尝试使用curl或Postman发送邮件.
If you are using the Firebase Notification Console to send the message, then you won't be able to set the tag
parameter there. Try using curl or Postman to send the message.
这篇关于FCM-收到新的推送通知时,删除旧的推送通知磁贴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!