I am implementing FCM notifications in Android, but how does notifications differ depending on the app status (background vs. foreground)?
In case some lands here in 2019, you can simply add an image field to the notification object:
{
notification: {
title: title,
body: body,
image: "http://path_to_image"
},
data: {
click_action: "FLUTTER_NOTIFICATION_CLICK",
your_data: ...,
},
token: token
}
I have tested it using Flutter on Android and I would assume it works on native Android since they both probably use the same native SDK.