我正在尝试使用新的推送通知堆栈或将其替换为系统托盘中的
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