Don't invoke push notification when app is being used (running in foreground)
问题 In my android app, I receive push notifications via Firebase Cloud Messaging. The notifications work completely fine, the only problem is that I don't want to receive notifications when the app is running. When the user is using the ap, I am already displaying the notification internally so the push notification is redundant and annoying. Below is the code on how I invoke push notification: @Override public void onMessageReceived(RemoteMessage remoteMessage) { NotificationCompat.Builder