1

I am trying to display notifications in my flutter app using awesome_notifications package (https://pub.dev/packages/awesome_notifications) . Below is my code.

await AwesomeNotifications().createNotification(
    content: NotificationContent(
      id: UniqueKey().hashCode,
      groupKey: message.data["senderUid"],
      channelKey: 'basic_channel',
      title: message.data["title"],
      body: message.data["body"],
      summary: message.data["body"], // Anything you want here
      notificationLayout: NotificationLayout.Messaging,
    ),
  );

Below is my Json data

"message": {
    "token": recieverFcm,
    "data": {
        "title": senderName,
        "body": message,
        "chatRoomId": chatRoomId,
        "sender_profile_pic": senderProfilePic,
        "senderUid": senderUid,
        "click_action": "OPEN_CHAT_ROOM"
    },
    "android": {
        "priority": "high"
    },
    "apns": {
        "payload": {
            "aps": {
                "category": "OPEN_CHAT_ROOM"
            }
        }
    }
}

This works fine and I get notifications like below.

enter image description here

In here it is displaying the first letter of the sender's name as the icon/profile picture. Instead, I would like to display the real photo of the sender. This profile photo is already being sent by the JSON code.

How can I do this?

PeakGen
  • 21,894
  • 86
  • 261
  • 463

0 Answers0