我们如何通过使用Firebase云消息传递(fcm)在Android中进行推送通知来发送图像和图标

Neo*_*ixs 7 php notifications android ionic-framework

我想将推送通知中的图像和图标从Serverside(php)发送到应用程序。 猫的形象

我在Google上进行了搜索,但无法获得正确的结果。我得到了FCM PHP代码。我使用这些代码发送通知,但是当我使用“图像和图标”参数图像时,通知中不会收到。

在GCM中,很容易在“推送”通知中发送图标和图像

 $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"
    ) ,
Run Code Online (Sandbox Code Playgroud)

如果有人可以使用FCM发送通知中的图像和图标,请帮助我。

Neo*_*ixs 2

简而言之,我更改了我的插件并使用phonegap-plugin-push v2.0.x,它工作正常。现在我可以在通知中发送大图像了。

在此输入图像描述