i have implemented Firebase notifications in my application and handling the push messages in handleIntent(Intent intent)
method. Everything works fine and i'm able to receive messages in foreground and background. my question is how should i prevent android showing notification in system tray when app is in background?
Asked
Active
Viewed 1,625 times
2

Doug Stevenson
- 297,357
- 32
- 422
- 441

Ravi
- 881
- 1
- 9
- 23
-
How are you sending the message? Using the console, or through code you've written? If code, what is your payload? – Doug Stevenson Jul 03 '18 at 19:14
-
1Refer to [this](https://stackoverflow.com/questions/50854511/push-notification-received-while-the-app-is-in-the-foreground-is-different-from/50855227#50855227) answer for further clarification. Send data messages to be able to not show them automatically in system tray. If you're sending notification message through Firebase console you can't prevent them from showing in system tray if the app is in background. – madking Jul 03 '18 at 19:39
1 Answers
1
Removing "notification" tag from the main payload and using "data" helped to prevent notifications.

Ravi
- 881
- 1
- 9
- 23