Get all notifications that are currently displayed by the app - android

I have an app that receives notifications with data in them. I can retreive that data fine when the notification is tapped or when the app is active and the notification is received, but it doesn't work when I open the app with an active notification. Is there some way to see every notification from the app that is currently visible in the status bar?

Related

How to get a notification automatically processed by the app when received in HMS Push Kit and React Native?

I am using react-native v0.61.5 and latest versions of react-native-hms-push (App) and hms-push-serverdemo-nodejs.
My server app is able to send both Notification Messages both Data Messages.
What is unclear to me, is how messages must be implemented in order to have this:
when app is in a killed state: a messages is received, sounds on and a bubble appears, the user taps on the notification bubble, the App processes the notification payload while opening
when app is in a killed state: a messages is received, sounds on and a bubble appears, the user opens the App without tapping on the notification bubble, the App processes the notification payload while opening
when app is in a background state: a messages is received, sounds on and a bubble appears, the user opens the App without tapping on the notification bubble, the App processes the notification payload while opening
when app is in background state: a messages is received, sounds on and a bubble appears, the user opens the App without tapping on the notification bubble, the user opens the App without tapping on the notification bubble, the App processes the notification payload while opening
when app is in foreground state: a messages is received, sounds on and a bubble DOES NOT appears, (there are no bubbles to be tapped), the App processes the notification payload suddenly
We encountered some difficulties to satisfy all these 5 requirements listed above. What we have to send from server-side? Data Messages or Notification Messages?
We also tried to use:
let message = {
notification: {...},
android: {androidConfig..., notification: {foreground_show: [false|true]}},
token: new Array(pushDeviceToken)
};
both:
let message = {
data: notification,
android: {androidConfig..., notification: {foreground_show: [false|true]}},
token: new Array(pushDeviceToken)
};
But is seems that there is no the best option...
One more thing: it seems that foreground_show does not works for Notification Messages, when I keep the App in opened state and send a Notification Message with foreground_show: true, no bubble appears and the notification is not processed by the App.
The cause could also be a bad configuration on the App side. It is not very clear how to configure it, since we are new to HMS Push Kit.
Update
If the App is in a killed state, the push Data Messages notifications may cannot be received. If you do need to use the data message, you can apply for the Special Permissions of High-priority data messages.
But at the same time, the application conditions are strict, and it may difficult to pass.
Notification Messages can be triggered only after a user clicks the notification.
Therefore, For the "Notification Messages are not automatically processed by the App if it is in foreground state" scenario you mentioned,It is recommended that you first use the server interaction to cover the foreground scenario. If a message cannot be processed due to application in the background or Kill-State, use Notification Messages.
when app is in a killed state: a messages is received, sounds on and a bubble appears, the user taps on the notification bubble, the App processes the notification payload while opening
In common notification messages, you can choose Message > Notification > data to set the customized parameters (payload). When an application is opened, the onNotificationOpenedApp event can be invoked to obtain related content.
when app is in a killed state: a messages is received, sounds on and a bubble appears, the user opens the App without tapping on the notification bubble, the App processes the notification payload while opening
It is recommended that the app obtains related information through the connection to the application server when the app is started and clears existing notifications when the app is started (a native Android function).
when app is in a background state: a messages is received, sounds on and a bubble appears, the user opens the App without tapping on the notification bubble, the App processes the notification payload while opening
It is recommended that the app obtain related information through the connection to the application server and clear existing notifications during startup (a native Android function).
when app is in background state: a messages is received, sounds on and a bubble appears, the user opens the App without tapping on the notification bubble, the user opens the App without tapping on the notification bubble, the App processes the notification payload while opening
Same as the previous question.
when app is in foreground state: a messages is received, sounds on and a bubble DOES NOT appears, (there are no bubbles to be tapped), the App processes the notification payload suddenly
You can perform the configuration by referring to the following guide:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/android-fgrd-show-0000001050040126-V5?ha_source=hms1

Can Android apps automatically receive push notification content when it's delivered while the app is in foreground?

I'm an iOS developer and this behavior is natural in iOS. If the app is in foreground and there's push notification for the app, the app will receive the push notification content instead of the OS create push notification in the notification center. Now I want to help my fellow Android developer to do the same, but we don't know where to look. As far as he knows, Android app will never receive push notification unless the user tap on the push notification, even if the app is in foreground. We need this so we can refresh the chat screen when we receive push notification from the server that a new chat message is coming. Can this behavior emulated in Android? All this time, the way he retrieved new chat message is that every 5 seconds he queries the server for new messages.

Android - firebase notifications behaviour

As far as I understand regarding Firebase push notifications:
When the user taps on a notification while the app is closed the notification data arrives to the launch screen.
If the app is in foreground, the notification is fetched in the onMessageReceived method from the service that overrides FirebaseMessagingService
But... what I need to detect is...
When a notification has been received but the user didn't enter into the app tapping on it but clicking on the app icon.
I need to display a countdown popup when the notification is received, but in that case (clicking on the icon) I have no information about the received notification.

how to get push notification payload data when the app is in background in ionic framework,

Hi I'm able to get the push notification in my ionic android app. I can get the push notification when app is running or in background or closed.
I am alerting the notification payload data. When app is running when I send the push notification to the app I'm getting the alert with payload data.
When the app is in background or closed I get the notification. When I tap on the notification in the notification tray (i got to the app via notification tray ). I get the alert in the app when app opens.
But when app is in background or closed, I get the notification but when I got to the app via app icon or recent apps(not tapping the notification in the tray) I cannot get the alert.
I want to get the payload data when I go to the app by tapping the icon or recent apps too.
Please help me.

GCM notification is not received when App is not running

i'v implemented GCM and it works fine except one issue.
if application works in foreground or background notification are consumed by application. However, if notification received while application is killed. Than notification only shown in top bar. But application cant find it even when user launch app.
I notice when message is recived after rebooting device, message is shown ony on message center, but its not found by application. Than, after application started, than, it start to receive messages.
Than notification only shown in top bar.
You put that Notification there yourself. GCM does not display a Notification on its own.
But application cant find it even when user launch app.
The application "found" it to display the Notification.

Categories

Resources