Not working with below code:
@PWA(name = "App", shortName = "App", enableInstallPrompt = false)
@Theme(themeFolder = "app")
@CssImport(value = "./styles/example.css", themeFor = "vaadin-grid")
@PreserveOnRefresh
@Push
public class MainView extends AppLayout implements AfterNavigationObserver {
public MainView() {
...
IdleNotification idleNotification = new IdleNotification();
idleNotification.setSecondsBeforeNotification(90);
idleNotification.setMessage("Your session will expire in " +
IdleNotification.MessageFormatting.SECS_TO_TIMEOUT
+ " seconds.");
idleNotification.addExtendSessionButton("Extend session");
idleNotification.addRedirectButton("Logout now", "logout");
idleNotification.addCloseButton();
idleNotification.setExtendSessionOnOutsideClick(false);
UI.getCurrent().add(idleNotification);
}
}
Unfortunatelly notification not showing. I also tried set parameters in application.properties as:
vaadin.closeIdleSessions=false
vaadin.heartbeatInterval=true
vaadin.pushMode=true
but that does not solve the problem.
Can anyone help?