Android的推送通知:如何显示一个标题? [英] Android Push Notifications: How do I show a title?

查看:446
本文介绍了Android的推送通知:如何显示一个标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用的谷歌云消息API 推Android通知。我们正在执行 https://android.googleapis.com/gcm/send 端点有效载荷类似于:

We are using the Google Cloud Messaging API to push Android notifications. We are executing the https://android.googleapis.com/gcm/send endpoint with a payload similar to:

{
  "registration_ids" : ["..."],
  "data" : {
    "message" : "You received cash back!"
  }
}

通知工作以及手机显示我们的应用程序的标志,并从上述消息。然而,在通知没有标题(消息上方和标志的右侧):

The notification works and the phone shows our app logo, and the message from above. However, there is no title in the notification (above the message and to the right of the logo):

作为参考,我们使用的PhoneGap 3.3和PhoneGap的建设。

For reference, we are using Phonegap 3.3 and PhoneGap Build.

推荐答案

那么,在加入称号的暗刺固定它。我没能找到这个文件在 http://developer.android.com /google/gcm/server.html#params

Well, a stab in the dark of adding "title" fixed it. I wasn't able to find this documented at http://developer.android.com/google/gcm/server.html#params

{
  "registration_ids" : ["..."],
  "data" : {
    "message" : "You received cash back!",
    "title" : "Title"
  }
}

在文档

现在:
https://developers.google.com/cloud-messaging/server#payload

这篇关于Android的推送通知:如何显示一个标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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