Closed cbenhagen closed 2 years ago
I think you can use windowManager.isFocused() to determine if the app is in the foreground.
bool isFocused = await windowManager.isFocused();
if (!isFocused) {
_exampleNotification?.show();
}
Thanks!
Often this might be the exepcted behaviour as the notificaiton could also be displayed in your app. But what if the app is only living in the tray using tray_manager or similar?
The behaviour could be configurable in the plugin and maybe even default to always show the alert? Documentation is here.
This would hardcode the behaviour to always show the alert: