mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #389] Android: Auto-clearing + auto-deleting notifications #298
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#298
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @1dancook on GitHub (Aug 28, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/389
I saw on the readme about your baby and know your kiddo has probably just been born. Congrats! Cherish the time... your baby will change very fast.
I have two question related to messages expiring:
Is it possible to specify an expiration date? I scoured around trying to find if there was some expiration date that could be added to messages but couldn't find anything.
Do messages automatically expire right now? (Or does ntfy.sh delete messages older than X days old?) If so, how long do they last?
Cheers!
@binwiederhier commented on GitHub (Aug 29, 2022):
Not yet :-D
You cannot set an expiration date for a notification. I like the idea though, and I can't believe that we don't have a ticket for it. I know we've discussed it before on the Discord. We'd have to add a new field
expiry(orexpiresorexpiration), and then provide a way for the Android/web/iOS app to remove the notification (and delete it?) at the expiry date.Should it be fully deleted, or should we just cancel the notification?
Also: Canceling a notification is not possible on the web. Only on Android (and I believe iOS).
Notifications are automatically deleted from the server after 12h (globally configurable server-side), and are deleted based on whatever you configure in the Android app (1 week by default, iirc). Android notifications are never canceled based on time, only if you tap them or navigate to the topic screen.
@1dancook commented on GitHub (Aug 29, 2022):
Got it. That answers that question.
For setting expiration, the questions you posed show it is a little more involved than I had thought.
Maybe a potential use case could help to draw it out?
Situation: A script runs on a home computer to check the weather and post to ntfy if it is going to rain. The user will get notified on his smartphone. On a Monday the computer posts a message at 9am. The user was busy in a meeting all morning and didn't check his phone until lunch.
That information has a natural expiration-- it is (probably) a useless notification after a certain amount of time has passed. The user checking his phone at lunch to see a message "it's going to rain" might later check if his script is working properly when he sees clear skies!
In my head expired means throw it out! If a server can be configured to keep posts indefinitely, then maybe it makes sense to at least have the option where a post could expire and be deleted permanently based on a user decision. The flip side of that would be the ability to set a post to never expire (thus never get deleted) even though the server is set to wipe messages after X duration.
I'm not sure how that works to cancel a notification. Does it mean that a notification on a home screen can be taken away? That sounds fitting.
If the notification would persist in the app, it could be good to have some visual cue to let the user know it is expired (a different color, or something)
If it's the first baby, they often come late. Nothing to worry about. Just fattening up some more and contemplating a good exit strategy!! 🤣
Lots of anticipation... I hope and trust all will go well for both mother and baby.
@pcgeek86 commented on GitHub (Jan 13, 2023):
I would love to see the ability to expire notifications! As you're probably aware, notifications can easily be abused, and it would be nice to set them to automatically expire.
This would be especially useful so that you can set up periodic (ie. 15-minute), informational notifications, but if you put your phone down for a while (hours), the notifications won't get all backed up.
It looks like Android has the ability to "cancel" notifications, using
NotificationManager.cancel.https://stackoverflow.com/questions/23874203/create-an-android-notification-with-expiration-date
@risacher commented on GitHub (Jun 22, 2023):
In terms of canceling notifications on web - even if you can't cancel the notification popup, you could remove expired notifications in the web UI. (I keep ntfy.sh as a pinned tab.)
Both my current applications that use ntfy send (at least) daily notifications to let me know they're still alive. As such I don't care if they were alive two days ago - only the most recent notification is meaningful. An expiration feature would help with this.
@osering commented on GitHub (Jan 6, 2024):
Such messages would remind self-destructing/disappearing messages messages of Signal messenger, to enhance privacy
@binwiederhier commented on GitHub (Feb 2, 2026):
I just rediscovered this issue. Auto-clearing or auto-deleting notifications would be great. I love this idea.
Side note:
She was born a day later ❤️