lundi 21 novembre 2016

How to get gcm push notification server data in javascript for website

I used gcm for my website. I am getting response data is null in push event.please help me anybody.

'here is a message. message', 'body' => 'This is a title. title', 'click_action' => 'This is a subtitle. subtitle' ); $fields = array ( 'registration_ids' => $registrationIds, 'data' => $msg ); $headers = array ( 'Authorization: key=' . API_ACCESS_KEY, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt( $ch,CURLOPT_URL, 'http://ift.tt/YbbTRA' ); curl_setopt( $ch,CURLOPT_POST, true ); curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers ); curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) ); $result = curl_exec($ch ); curl_close( $ch ); echo $result; ?>

Aucun commentaire:

Enregistrer un commentaire