I am currently using PHP code to send Android GCM Push Notification
$msg = array
(
'message' => $message,
'title' => $title,
'vibrate' => 1,
'sound' => 'default'
);
$fields = array
(
'registration_ids' => $registrationIds,
'data' => $msg
);
$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 always receive a blank (white square) in notification. I didn't specify any icon for notification in the Android app - just the default app icon set.
I can send an image in data, but the notification icon is still blank:
'image' => 'http://www.example.com/image.png'
I have tried to set an URL for 'icon', 'smallIcon', 'largeIcon', but not successful. I am using Apache Cordova and com.adobe.phonegap.push.PushPlugin.