gcm.notification.e = 1代表Android中的推送通知载荷代表什么? [英] what does gcm.notification.e=1 stand for, into push notification payload on Android?

查看:124
本文介绍了gcm.notification.e = 1代表Android中的推送通知载荷代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个Android应用程序,使用Google Cloud Messaging从服务器接收下游消息。当收到一封包含 onMessageReceived 的消息时,我打印这个包并阅读:

 接收的推送通知:捆绑[{gcm.notification.e = 1,gcm.notification.badge = 1,gcm.notification.sound =默认,..等等... 

我无法理解通知有效内容中的关键字 gcm.notification.e 。在Google文档中,我没有发现类似的东西。
此外,在发送消息时,我通常同时指定通知有效载荷和数据有效载荷。现在我试图删除通知有效负载,但我仍然收到gcm.notification.e = 1



有人可以帮助我理解此密钥并找到一种方法将其删除?
谢谢


编辑:我发现没有通知有效载荷发送一条消息,并且 content_available = false (我使用iOS设置它为true),那么没有收到 gcm.notification.e = 1 。我只收到数据负载:)。不过,我仍然想知道这个 e的含义。

也许这个 e 字段代表 enable 。如果您在服务器中将其设置为 zero ,您将不会收到Android上的通知有效内容。有关更多详情,请参阅我的答案此处


I'm writing an Android application which receives downstream messages from a server using Google Cloud Messaging. When receiving a message with onMessageReceived I print the bundle and read this:

RECEIVED PUSH NOTIFICATION: Bundle[{gcm.notification.e=1, gcm.notification.badge=1, gcm.notification.sound=default, ..etc...

I don't understand the key gcm.notification.e in the notification payload. On Google documentation I didn't find anything like that. Moreover, when sending the message, I usually specify both a notification payload and a data payload. Now I tried to remove the notification payload but I still receive gcm.notification.e=1

Someone can help me understand this key and find a way to remove it? Thanks

EDIT: I found out that sending a message without the notification payload and with content_available=false (I set this to true when working with iOS) then the gcm.notification.e=1 is not received. I receive only the data payload :). However, I still want to know the meaning of this e

解决方案

Maybe this e field stands for enable. If you set it to zero in your server you won't receive the notification payload on Android. For more details se my answer here.

这篇关于gcm.notification.e = 1代表Android中的推送通知载荷代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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