CopyPastor

Detecting plagiarism made easy.

Score: 0.8311231324511967; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2021-05-07
by Sreehari K

Original Post

Original - Posted on 2016-05-23
by Arthur Thompson



            
Present in both answers; Present only in the new answer; Present only in the old answer;

This is working as intended, notification messages are delivered to your onMessageReceived callback only when your app is in the foreground. If your app is in the background or closed then the system tray will receive the message and read body and title from the notification block and shows the default message and title in the notification bar, and any data from that message is passed to the intent that is launched as a result of the user tapping on the notification.
**Reference Link:** [https://firebase.google.com/docs/cloud-messaging/android/receive][1]

[1]: https://firebase.google.com/docs/cloud-messaging/android/receive
This is working as intended, notification messages are delivered to your onMessageReceived callback only when your app is in the foreground. If your app is in the background or closed then a notification message is shown in the notification center, and any **data from that message is passed to the intent** that is launched as a result of the user tapping on the notification.
You can specify a click_action to indicate the intent that should be launched when the notification is tapped by the user. The main activity is used if no click_action is specified.
When the intent is launched you can use the
getIntent().getExtras();
to retrieve a Set<String> that would include any data sent along with the notification message.
For more on notification message see [docs][1].

[1]: https://firebase.google.com/docs/cloud-messaging/downstream#sample-receive

        
Present in both answers; Present only in the new answer; Present only in the old answer;