<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', ' AIzaSyAxkph8XmQAwi8gB1d91AsgbZFm_-oeg_M' );
$registrationId = array("APA91bEi9r3S03HuEqOSvR2WtbmnJwphbnnmxXJ2vMopN7IXoercnDUeldCvNubvYE7IH-ffJFVjr-fsBJQ8x_RM-rC4eiEYedWI4G82qf1rRA7G1CRG5Rw");
// prep the bundle
$msg = array
(
'message' => 'here is a message. message',
'title' => 'This is a title. title',
'subtitle' => 'This is a subtitle. subtitle',
'tickerText' => 'Ticker text here...Ticker text here...Ticker text here',
'vibrate' => 1,
'sound' => 1,
'largeIcon' => 'large_icon',
'smallIcon' => 'small_icon'
);
$fields = array
(
'registration_ids' => $registrationId,
'score' => $msg
);
$headers = array
(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);
$ch = curl_init();
curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );
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;
?>
preferences:
62.4 ms | 402 KiB | 5 Q