2

Is it possible to read the push notification information (Both notification {} and data{} from FCM), without tapping/clicking on the notifications. ?

As for the the Documentation, Notification come your app, either it is in foreground or background, But in these case of background, a notification is delivered to the device's system tray, and the data payload is delivered in the extras of the intent of your launcher Activity.

But my requirement is to read the notification without clicking on it.

Is it possible..? if yes please give me some information / some links.

1 Answers1

-2

You can use FCM data message instead of notification, everytime you receive a new data message onMessageReceived will be called and you can choose either to show this notification or not, and will get all relevant data.

Roshaan Farrukh
  • 399
  • 3
  • 10
  • you are wrong. When the application is on background the onMessageReceived method is not called. – aurelianr Aug 28 '19 at 12:46
  • If your server is sending you data message then it doesnt matter whether your application is in background or foreground onMessageReceived() will be called read this thread https://stackoverflow.com/questions/37358462/firebase-onmessagereceived-not-called-when-app-in-background – Roshaan Farrukh Aug 29 '19 at 10:41
  • ... notification messages are delivered to your onMessageReceived callback only when your app is in the foreground. Look at The accepted answer. The other data îs passed to intent în extras parameters – aurelianr Aug 30 '19 at 04:35
  • Read Md. Sajedul Karim's answer where he is defining types FCM. – Roshaan Farrukh Aug 30 '19 at 10:38