Firebase Expandable Notification Show image when app is in background

前端 未结 12 2061
深忆病人
深忆病人 2020-12-23 14:19

I am implementing FCM notifications in Android, but how does notifications differ depending on the app status (background vs. foreground)?

12条回答
  •  失恋的感觉
    2020-12-23 15:01

    FCM notification messages don't support the largeIcon or bigPicture.

    if you need them while in background you can use a FCM data message.

    For data messages the onMessageReceived(message) method is always called, so you can use the message.getData() method and create your custom notification.

    Read more about notification messages vs data messages here: https://firebase.google.com/docs/cloud-messaging/concept-options#notifications_and_data_messages

提交回复
热议问题