![](/img/trans.png)
[英]Android push notifications tutorial: how do I send notifications to “followers”?
[英]Android Push Notifications: How do I show a title?
我們正在使用Google Cloud Messaging API推送Android通知。 我們正在執行https://android.googleapis.com/gcm/send端點,其有效負載類似於:
{
"registration_ids" : ["..."],
"data" : {
"message" : "You received cash back!"
}
}
通知有效,手機會顯示我們的應用徽標以及上面的消息。 但是,通知中沒有標題(在消息上方和徽標右側):
作為參考,我們使用的是Phonegap 3.3和PhoneGap Build。
好吧,在黑暗中加入“標題”修復了它。 我無法在http://developer.android.com/google/gcm/server.html#params上找到此文檔
{
"registration_ids" : ["..."],
"data" : {
"message" : "You received cash back!",
"title" : "Title"
}
}
現在在docs中: https : //developers.google.com/cloud-messaging/server#payload
它在我身邊
$ message = array(“message”=> $ pushMessage,“title”=>“我的通知”);
$ fields = array(“registration_ids”=>“ device id to send notification
”,“data”=> $ message);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.