I am implementing FCM notifications in Android, but how does notifications differ depending on the app status (background vs. foreground)?
If your expecting only one notification in a system tray for your app then the below solution can solve the problem, until FCM comes up with proper solution.
remove MyFirebaseMessagingService from manifest.
Add MyGcmReceiver in manifest
cancelAll notifications before notifying the notification. (Otherwise firebase also, shows notification when app is in background)