Android集合多个推送冲突,android – Firebase发送多个推送通知,而不是堆叠或替换...

我正在尝试使用新的推送通知堆栈或将其替换为系统托盘中的

android.

我不知道如何执行此操作,因为推送通知正在发送回数据和通知对象,并且据我所知,通知直接发送到系统托盘.如果是这样,我如何阻止通知独立出现.有些用户会收到5-10个通知,而且会继续推升.

编辑:

我尝试了collapse_key,但它仍然没有用相同的密钥替换先前的通知……我在这里做错了吗?

method: 'POST',

uri: 'https://gcm-http.googleapis.com/gcm/send',

headers: {

'Content-Type': 'application/json',

'Authorization': authorize //GOOGLE API KEY

},

body: JSON.stringify({

"registration_ids": [otherUserResult.reg_id],

"collapse_key": "follow",

"data": {

"notifyToUserId": to,

"notifyFromId": from,

"notifyMsg": msg,

"notifyItemPicture": itemPic,

"notifyItemName": itemName,

"notifyFromName": fromName,

"notifyType": type,

"dateNotified": dateNotified

},

"notification": {

"title": fromName,

"body": notifyMsg,

"icon" : "ic_pushnotify"

},

"priority": "high",

"content_available": true

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值