corona gcm client

local function printTable(table, stringPrefix) if not stringPrefix then stringPrefix = "### " end if type(table) == "table" then for key, value in pairs(table) do if type(value) == "table" then print(stringPrefix .. tostring(key)) print(stringPrefix .. "{") printTable(value, stringPrefix .. " ") print(stringPrefix .. "}") else print(stringPrefix .. tostring(key) .. ": " .. tostring(value)) end end end end local function onNotification(event) if(event.response~=nil)then print("IN : SCENE1 | ONNOTIFICATION | ### --- Notification Event --- RECEIVED: "..event.response) elseif(event.game\_msg~=nil) then print("IN : SCENE1 | ONNOTIFICATION | ### --- Notification Event --- GAME\_MSG: "..event.game\_msg) else printTable(event) end end

Am unable to read data from gcm event packet.

In logs it reads like:

### type: remote ### name: notification ### custom ### { ### } ### alert: ### applicationState: active

my server is in php

using this code:

function sendNotification( $apiKey, $registrationIdsArray, $messageData ) { $headers = array("Content-Type:" . "application/json", "Authorization:" . "key=" . $apiKey); $data = array( 'data' =\> $messageData, 'registration\_ids' =\> $registrationIdsArray ); $ch = curl\_init(); curl\_setopt( $ch, CURLOPT\_HTTPHEADER, $headers ); curl\_setopt( $ch, CURLOPT\_URL, "https://android.googleapis.com/gcm/send" ); curl\_setopt( $ch, CURLOPT\_SSL\_VERIFYHOST, 0 ); curl\_setopt( $ch, CURLOPT\_SSL\_VERIFYPEER, 0 ); curl\_setopt( $ch, CURLOPT\_RETURNTRANSFER, true ); curl\_setopt( $ch, CURLOPT\_POSTFIELDS, json\_encode($data) ); $response = curl\_exec($ch); curl\_close($ch); return $response; } $response = sendNotification( $apiKey, array($registrationId), array('message' =\> $message, 'tickerText' =\> $tickerText, 'contentTitle' =\> $contentTitle, "contentText" =\> $contentText) );

src:http://distriqt.com/post/1273

I cant read any of the tags as shown in logs.

How to do it?