Foreground or background handling on Android by message type

To receive messages in an Android app, you must consider the foreground or background state of the app, together with the message type. If the problem message is a notification message with a data payload, try the notification message debugging steps first.