Closing Notifications from external source

Hello.

The App I’m creating has an openable Notification that stays open until a certain condition is checked. I have a ScheduledExecutorService that initiates once the Notification is open and checks for that condition, and shuts down once the condition is satisfied. Every time the condition is satisfied I can’t seem to get the notification to close at all. I’ve tried to use UI.getAccess() but it doesn’t seem to work, are there any fixes you could recommend?

Have you enabled push with the @Push annotation?

Oh wow, thank you. That worked perfectly!! Been scratching my head trying to fix this all day since the notification.isOpened() returns false but the UI element is still visible. Tried to manually reload the page but it was futile. This fixed everything!! Thank you!

1 Like