This is my code to send Notification :
$msg = array
(
"title" => "Portugal vs. Denmark",
"message" => "5 to 1"
);
$fields = array (
"to" => $deviceToken,
"data" => $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 );
I receive the "5 to 1"
message but the title "Portugal vs. Denmark"
is not displayed.
Does anyone have an idea ?
In the data
field I tried alert
, subtitle
and they did not change anything.
Thank's
EDIT
Screenshot of the notification I have