Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How we can send image and icon by using Firebase cloud messaging(fcm) for push notification in android

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.

like image 316
Neotrixs Avatar asked Nov 22 '16 07:11

Neotrixs


1 Answers

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

like image 67
Neotrixs Avatar answered Oct 23 '22 11:10

Neotrixs