有没有办法在向GCM发送通知时检索设备上的密钥“消息” .
{ "collapse_key" : "score",
"data" : { "k1" : "v1" },
"message" : "Hello World!",
"registration_ids" : [ "DEVICE_REGISTRATION_ID_GOES_HERE" ]
}
从intent.getExtras(),我能够收到以下键“ collapse_key ", " from ", " k1 " and their corresponding values as well. However I do not get key " message ". If I do not add anything in the " data " dictionary, I still get push notification without " k1 ”(正如预期的那样) .
推送到GCM不会导致错误 . GCM是否删除“ data ”字典中未提及的密钥?
1 回答
是的,你拥有它的方式是行不通的 . 您要添加的任何内容,使其成为数据对象的一部分: