I am sending a push notification using firebase endpoint. It is working successfully. I am using postman to send the request to FCM. My issue is I do not understand how to send a large icon with it.
FCM has two types of payloads you can send. Data payloads and notification payloads. See here. I'm focusing on notification payloads. How do I specify a local large icon to show ? I know I can specify a default notification icon in the manifest this way using metadata:
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/mylogo" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/mycolor" />
But this is for a small icon. How do I specify LARGE icon I'd like to use ?
In the documentation I provided above for FCM, there is a example that looks like this:
{
"to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
}
}
but this is for small icon. how to do large icon?
A large icon looks like this:
Build the send requestIn your notification send request, set the following AndroidConfig option: notification. image containing the image URL.
FCM is the new version of GCM under the Firebase brand. It inherits GCM's core infrastructure to make sure we continue to deliver messages reliably on Android, iOS and Chrome. Save this answer.
For Android, you can send up to 240 messages/minute and 5,000 messages/hour to a single device.
FCM doesn't have an API to set a large-icon.
If you want to achieve that you can send a data-message
with custom payload, and create your own local notification inside onMessageReceived()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With