react-native-fcm icon indicating copy to clipboard operation
react-native-fcm copied to clipboard

Adding an image to the notification

Open shraddha1704 opened this issue 10 years ago • 4 comments

RN v0.34 Running on Android 6 device

How can we send a image in the notification and show it in the notification tray?

shraddha1704 avatar Oct 13 '16 12:10 shraddha1704

Basic FCM notifications (and thus this package) don't support that. If you want that, you need to:

  • send just data notifications through the firebase API.
  • build your own background service that listens for those.
  • build a local notification with all the data you want to show.

dslounge avatar Oct 18 '16 20:10 dslounge

react-native-fcm supports icon which will display an icon in the notification tray. This can be sent both from a server or as a local notification. Note that this parameter takes an icon name. The actual icon needs to be stored in the standard android mipmap folders and built into your application.

For the notification to be displayed on Android 5.0+, the icon must have a transparent background. If it does not have a transparent background, it just shows up as an empty white square when you pull down notifications.

I would also recommend setting color which sets the background color in the circle behind the notification icon when you pull down notifications.

ghuh avatar Oct 20 '16 03:10 ghuh

@shraddha1704 have u solved ur problem?

sibelius avatar Dec 12 '16 13:12 sibelius

close due to inactivity

evollu avatar Jan 05 '17 15:01 evollu