FCM - 收到新的推送通知时删除旧的推送通知磁贴 [英] FCM - Remove Older Push Notifcation Tiles when a new Push Notiifcation is recieved

查看:27
本文介绍了FCM - 收到新的推送通知时删除旧的推送通知磁贴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Xamarin Forms 中实现了 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.

我尝试过使用相同的collapse_key,但收到的是所有消息而不是最近的推送.

I have tried using the same collapse_key, but all the messages are received instead of the recent push.

有人可以帮我解决这个问题吗?

Can someone help me with this?

推荐答案

你应该继续使用 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 通知控制台发送消息,那么您将无法在此处设置 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆