mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #417] Emergency Priority on Android #322
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#322
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 @danmed on GitHub (Sep 29, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/417
I've been trying out ntfy and it's.. well it's awesome.. so much quicker than pushover..
The problem i have is that i want to use it for my alarm notifications but i cannot figure out how to set it as an emergency alert on android.
My phone is almost always on vibrate only and after 11pm it's in DND.
I've figured out how to ignore DND.. but how can i get it to ignore vibrate and play a sound (loud!)
With pushover I set the priority to 2.. but i can't find the equivalent with ntfy
@binwiederhier commented on GitHub (Sep 30, 2022):
I just tried and if I
It will play a sound even with DND.
Here's what that looks like. You can even set a custom ringtone for max priority items:

@binwiederhier commented on GitHub (Sep 30, 2022):
I found this is a great sound for max priority: https://cdn.freesound.org/previews/607/607878_12946258-lq.mp3
@danmed commented on GitHub (Sep 30, 2022):
Hi,
thank you for your reply, but i don't want to take my phone off silent... (for a few reasons).. I was just wondering if NTFY could by pass the "silent" mode like pushover can.
@binwiederhier commented on GitHub (Sep 30, 2022):
Doesn't DND override all sounds and mutes them?
I thought I had looked into that and decided it wasn't possible. But if Pushover does it, it must be possible ... It's a valid request.
@danmed commented on GitHub (Sep 30, 2022):
Thank you for considering it.. here is the Pushover info : https://pushover.net/api#priority
@danmed commented on GitHub (Nov 13, 2022):
I had to set up pushover on my phone again (new phone) and by default it wasn't bypassing my DND.. it turns out i'd had to alter some settings in the client and the main one is to play high priority alerts as through the alarm channel which bypasses DND / Silent mode.. maybe that will assist in progressing this one! (it also allows customising the sound played for high priority alerts)
@binwiederhier commented on GitHub (Nov 13, 2022):
If you could share the steps or screenshots that'd be helpful :-D
@danmed commented on GitHub (Nov 14, 2022):
This is just in the settings for the pushover app on Android... nothing else i can really share i'm afraid...
@binwiederhier commented on GitHub (Nov 17, 2022):
What app is that from? Is that from Android, or in Pushover? It'd be more helpful if you could provide specific steps in Android. If it's a pushover setting, then don't bother, because I won't know what Pushover does under the hood.
@danmed commented on GitHub (Nov 17, 2022):
It's Pushover.. i just figured that the description of what it does might
help
On Thu, Nov 17, 2022 at 2:44 PM Philipp C. Heckel @.***>
wrote:
@binwiederhier commented on GitHub (Nov 28, 2022):
I have managed to produce a looping alarm sound, even with DND enabled, and even when the phone is silent. I think I can make a similar toggle to the screenshot above. Working on this now.
@danmed commented on GitHub (Nov 28, 2022):
Awesome!
@binwiederhier commented on GitHub (Nov 29, 2022):
Alright I got something that reliably works. It is a little odd that it's not possible to configure the sound for this (yet), so I have to pick a sound. For my phone, the default notification sound (on repeat) works the best, but I don't know if that's ok with other phones.
I'm going to implement it this way and later, maybe if I ever get to #6, we can make this configurable.
@danmed commented on GitHub (Nov 29, 2022):
Happy to give it a test.. I'm using a pixel 6a
On Tue, 29 Nov 2022, 20:22 Philipp C. Heckel, @.***>
wrote:
@binwiederhier commented on GitHub (Nov 29, 2022):
Well, right now there is no toggle and the notification sound will literally not stop looping until you kill the app. So I'll let you know when I have something that is actually close to ready.
@binwiederhier commented on GitHub (Nov 30, 2022):
Here's an .apk you can try: https://drive.google.com/file/d/11ZbKDPz4fz9RvvtAi1W3ylATr_L5AlOG/view?usp=share_link
(Be sure to back up your config using Settings -> Backup)
@binwiederhier commented on GitHub (Nov 30, 2022):
@danmed Let me know if it generally works for you.
There has been a discussion on Discord/Matrix about this feature, and about whether or not to add a new priority level or a new flag to trigger this insistent behavior. Here are the options
Priority: 6(akaPriority: emergency), which will by default trigger the looping sound. There would be a cllient-side toggle to switch this behavior off. This is a little weird, because now the max priority is not the highest anymore. This requires server side changes, and may be a slightly breaking change for clients.Insistent: yesheader, which will by default trigger the looping sound. There would be a client-side toggle to ignore this flag. This is a little off for something likePriority: min; Insistent: yes, because that would not alert at all. This requires server side changes.Arguably, option 1+2 are kind of the same, because they both have a client-side toggle to turn the behavior off/on.
Thoughts?
@danmed commented on GitHub (Dec 4, 2022):
Hey, really sorry.. it's been a hectic weekend.. ill try and test the APK
in the next couple of days..
as for the options for implementation.. it makes sense to me to have a new
priority for it but i do understand the breaking changes this could cause..
On Wed, Nov 30, 2022 at 7:36 PM Philipp C. Heckel @.***>
wrote:
@binwiederhier commented on GitHub (Dec 5, 2022):
No worries.
I have pretty much decided to either no release this feature at all, or just the same way that you suggested, with a new option that redefines priority 5 (option 1).
The problem is that I have not had much success getting people to try it. So far two people have tried. It worked for one, and not the other. So rather than releasing a brittle feature that no-one wants, I'd rather not release it at all.
Maybe I can get some more people to test once I have a few more features bundled into an RC.
@binwiederhier commented on GitHub (Dec 5, 2022):
Current score:
@wunter8 commented on GitHub (Dec 6, 2022):
Works: @wunter8 on Pixel 5 (Android 13)
@binwiederhier commented on GitHub (Dec 8, 2022):
This is now 100% implemented in https://github.com/binwiederhier/ntfy-android/pull/49 -- It includes a per-subscription setting.
I'm going to wait with merging it until I get the Google Play stuff sorted out.
@binwiederhier commented on GitHub (Mar 13, 2023):
I forgot to close this ticket. This was merged and released some time ago.
@jvandenbroek commented on GitHub (Oct 24, 2023):
Unfortunately this feature doesn't seem to work on my Poco F3 with MIUI 13. Log gives the following traceback:
There is no option to make DND exemptions per notification on this ROM as shown by OP, really annoying and I will probably avoid MIUI in the future. However for some reason it does work even without this setting on the Home Assistant app by setting the channel to alarm_stream: https://companion.home-assistant.io/docs/notifications/critical-notifications/#android-alarm-stream
So if the same logic could be implemented in ntfy, I (and probably others) would be very happy :-) Thanks for the great work!
Edit: After some more testing I got it working with the built-in system notifications. Selecting a custom one in shared storage doesn't work when DND is enabled.
@juanrgm commented on GitHub (Nov 30, 2023):
Customizing the number of intervals and delay between sounds would be great.
In the meantime I had to add a delay to the end of the audio track with ffmpeg.
@gwlg-mjh commented on GitHub (Mar 7, 2024):
Thanks, I was looking for a way to be able to override the silent mode so I can do a find my phone feature with Alexa and Home Assistant and not have to boot up a pc or laptop and do the Google/Samsung version. The only thing I would say is that when I originally saw this option in the settings it wasn't obvious that it would override the silent/vibrate setting on the phone.