8

I want to send an image and icon in my Push notification from my Serverside(php) to my app. image of cat

I have searched on Google but was unable to get the proper result. I get FCM PHP Code. I use these code for sending notification but when I use "image and icon" parameter image not receive in notification.

In GCM it's easy to send icon and image in Push notification

 $fields = array(
    'registration_ids' => $registrationIDs,
    'data' => array(
        "title" => "SamplePush Application",
        "style" => "inbox"; //picture/inbox,
        "message" => "I am just testing Push notification",
        "notId" => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "summaryText" => "Venha provar os nossos Gins",
        "image" => "http://gintonico.com/content/uploads/2015/03/fontenova.jpg",
        "picture" => "http://media5.letsbonus.com/products/285000/285006/14014409744462-0-1700x690.jpg"
    ) ,

If anyone can send image and icon in notification using FCM please help me.

Community
  • 1
  • 1
Neotrixs
  • 2,369
  • 2
  • 24
  • 54

2 Answers2

2

Simply, I change my plugin and use phonegap-plugin-push v2.0.x and it work fine. Now I am able to send big image in the notification.

enter image description here

Neotrixs
  • 2,369
  • 2
  • 24
  • 54
0

Notification image must be PNG image. Replace jpg image with png image.

Krunal
  • 297
  • 1
  • 7