Android Chrome Notification - Notification Tray doesn't hide after clicking notification action - android-notifications

I am using the ServiceWorker Notification API in Android Chrome to show notifications with actions.
I am using notifications with tag and silent: true, but that should not matter.
The notificationclick handler finds a WindowClient and calls focus() on it. I am NOT closing the notification in the handler.
That all works as intended, but I am not happy with the behaviour of the notification tray.
When I click on the body of my notification, the notification tray closes itself, but when I click on any of the notification actions, the action itself is performed but the notification tray stays open. Which means even though the browser is now "in focus", it is still behind the notification tray, which I have to close manually by swiping.
Closing the notification in handler makes no difference (notif closes, tray stays open).
I doubt, that the Chrome API would let me solve this, but maybe someone has a solution.
Thanks

Related

Capacitor push notifications for Ios are empty when clicking on the notification banner

My app uses push notifications (Ionic Capacitor) and when I enter the app I use getDeliveredNotifications() to get all the notifications to display. This works great if the user clicks on our App icon but when the user clicks the notification banner I get an empty array back.
Its like the notifications get wiped before getDeliveredNotifications gets called. Any thoughts on what I might try to fix? I checked this on Android and it works as expected...

iOS Push - display message if app is active

I'm implementing Push in a Xamarin Forms PCL project, and I'm having an issue with iOS.
If the user is actively using the app I want to display an alert to let them know they have received a notification and let them choose to View it (which changes the current page) or cancel.
If the app is not active, either in the background or not running, I want to go directly from the tap on the iOS notification to the notification page - no alert. I have this working if the app is not running.
If the app is running, either in the background or active, the RecievedRemoteNotifications function is called which will display the alert. I don't see a way in RecievedRemoteNotification to determine if the app was already active or if the user tapped the system-generated notification.
Check out the ApplicationState property from UIApplication.SharedApplication.
More information about the possible values here. There is a Background state.

Tapping on the app icon does not display the notification in the app

I am using the Event source-based notifications in hybrid applications sample from https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/notifications/push-notifications-hybrid-applications/event-source-based-notifications
When I receive a push notification and I tap on the app icon instead of tapping the notification in the notification bar, the notification isn't pushed and still appearing on the notification bar. Only if I tap on the notification bar, even if the app is open, the notification is pushed and is deleted from the notification bar.
There are no problems if the app is open when I receive the notification.
How I can force the notification to be pushed when I tap on the app icon rather than tapping the notification in the notification bar?
MobileFirst 7.0.0
Android Environment
I have indeed reproduced this. It appears to be a regression.
After a push is received and you then tap either the incoming notification in the notifications bar or the app icon
the app is supposed to launch
you are then prompted to login
push support etc is checked for, and finally
if there's a notification in the queue then it is supposed to be displayed (the pushNotificationReceived function is supposed to be called). This is not happening when tapping on the app icon
If you are an IBM customer or business partner I suggest for you to open a PMR (support ticket). This is going to be investigated by the development team...

How to display a notification in worklight when returning to the foreground?

I am using push notification in worklight 6.2 in one of my apps.
I have a issue regarding receiving of notification. i receive notification when i am in the application .
When i close my app or made my app go background, i receive notification in the status bar and when i click on that,its taking me to the app ask for the authentication which is provided in the app and then goes to the inbox where all the messages are listed the new message is displayed .
But when i receive the notification when my apps is in background and see the notification in status bar and without clicking that notification if i opened the application and see the inbox page ,the message is not displayed because the function which will be executed when receiving notification is not called.
I need to give solution to avoid this. Is there any way or option to display the notification which is received when the app is in background and when the app is opened without opening the notification in status bar.
Thanks in advance
Perhaps you could use a the Cordova resume event, from which you will call the pushNotificationReceived() function as the callback function.
document.addEventListener("resume", pushNotificationReceived, false);
The basic premise is that if a notification was received while you were in the background, then once returning to the foreground the above should executed and the notification will be displayed.
Again, this is just the basic premise and you'll probably need to modify the pushNotificationReceived() implementation to account for what happens when you get back to the foreground but there are no notification (you could implement some logic to check that...) and various other scenarios, as you encounter them.

iOS5 Push notifications, Are there any alternatives to the Notification Center?

I have 2 related questions regarding the new push notification in iOS5:
If my application is not running in the background - Can the notification arrive to my application silently?
Can I revert back to the old modal popup UI for push notification? Can I do it programmatically only for my application notification while leaving all the rest using the notification center disappearing notification?
You can send a silent message by not providing the sound property with the push message.
You cannot revert back to the old modal popup.

Resources