[Notification] Why are notifications not sent when the app is in the foreground?
Looking inside AWSPinpointPushNotificationsPlugin.handleNotificationReceived(), notifications are not displayed on the device when the app is in Foreground.
In some cases it may appear as if it could not be sent, which can be a source of confusion.
If this is the intention, it should be noted in the comments.
https://github.com/aws-amplify/amplify-android/blob/97ddb8b546c9d9f1807314eff2928cc0ca6afd92/aws-push-notifications-pinpoint/src/main/java/com/amplifyframework/pushnotifications/pinpoint/AWSPinpointPushNotificationsPlugin.kt#L329
Thank you for posting this - the team will take a look and post updates here.
It is intended as the standard behavior for Android notifications is to only display in the background: https://firebase.google.com/docs/cloud-messaging/android/receive.
This behavior is documented here: https://docs.amplify.aws/gen1/android/build-a-backend/push-notifications/record-notifications/#handle-notification-received.
If you want to show notifications while in the foreground, you can modify your extension of the FirebaseMessagingService to fit your needs.
I'll mark this as a feature request to clarify this behavior in code comments.