I have a scenario when i don't want android system to display push notification if app is in foreground.
Instead i want to display some view or launch activity in the app.
This is my code.
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage);
//...
//...
sendNotification(remoteMessage.getNotification(), subtitle);
}
If i comment out sendNotification()
method, it does not display notification on both background & foreground cases.