nucleus-ffm / foss_warn

An unofficial open source application to get emergency alerts from https://warnung.bund.de/meldungen.
GNU General Public License v3.0
98 stars 6 forks source link

Use permanent Notification for background service #83

Closed ChaosNicro closed 1 year ago

ChaosNicro commented 1 year ago

Heya, thanks for providing this.

I happen to have a few apps using notifications for staying awake. Though FossWarn seems to not use the commonly used permanent notification call for it's status. Compared to the others, I can swipe the status away and have done so by accident a few times. This seems to kill the service, since I stop receiving alerts until I fully close and reopen the app. Is this the intended behaviour? I would expect the notification to not be removable unless disabled in settings. Cheers

nucleus-ffm commented 1 year ago

FOSS Warn does not currently use a foreground service that requires a permanent notification. FOSS Warn uses an alert manager that wakes FOSSWarn after a certain period of time. If you turn off the notification, it should have no effect on functionality. What makes me curious is the fact that you write that you won't get alerts if the notification is not displayed. Are you sure about that? If the notification is displayed, does it update periodically? If you cancel the notification, it should be displayed again at the next background update. (so by default 15 minutes)

But thanks for pointing that out. I have now added the attribute "ongoing" to the status notification. So with the next version you won't be able to cancel it accidentally.

ChaosNicro commented 1 year ago

I can't say for certain. I distinctly had the situation before posting this, where it was storming outside and I was wondering why there were no alerts. I opened the app to find that there were a couple for the place I set. I checked Androids and FossWarns notification settings to find them all enabled and confirmed that battery optimization was off. The App might have simply not been running for some reason. As long as I'm the only case, there is nothing to worry about. Close this if you like.

nucleus-ffm commented 1 year ago

This is not good to hear. Please keep an eye on this. For the next situation, please always check if the release date is newer than the last update. Sometimes it just takes a few more minutes and there would be a notification.

If you notice the same problem again, please open another issue.