0

onMessageReceived(RemoteMessage remoteMessage) not called when app in background or killed only showing json string like {"body":"test","title":"test notification}

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

2 Answers2

0

onMessageReceived() this method of fcm will not trigger when your app is in background or killed mode. In such case system notification tray will generate notification. Here is the link you can see more in detail. Docs

Ehsan Ullah
  • 175
  • 10
  • please read below link you will find better solution.[Click Here...](https://stackoverflow.com/a/43869272/13875707) – Ehsan Ullah Sep 14 '20 at 14:01
0

Try to send Data only messages to FCM. It will be triggered all the time. Don't forget to set high priority for the messages!

Abdu ssamad
  • 81
  • 1
  • 5