0
我試圖從Google Cloud Message(GCM)的消息中獲取一些信息。消息是這樣的:獲取來自Google雲消息傳遞的json數據
{
"category":"com.myappplication",
"data": {
"my_message":"this data i need",
"my_action":"com.google.android.gcm.demo.app.ECHO_NOW"
},
"time_to_live"86400,
"message_id":"5",
"from":"ADJEKRJEKRJEKJREKRJLSDLKSJDLKJ23DSD22232320DSLKJ23"
}
我只能得到數據出「從」,「MESSAGE_ID」和「time_to_live」的。
在我的PHP腳本我解碼進來的JSON消息
$gcm_in = json_decode(str_replace(""", "\"", $stanza_in->childrens[0]->text));
$from = $gcm_in->from;
如何獲得my_message的信息?