mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #6] Android app: per-subscription / per-priority notification sound #5
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#5
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 @binwiederhier on GitHub (Nov 19, 2021).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/6
@Mikaela commented on GitHub (Jun 1, 2022):
This would also be nice on iOS as I tend to default to silent so most applications won't bother me unnecessarily
@inconis commented on GitHub (Jun 29, 2022):
On Android devices will be helpful the option to override system settings regarding noise.
In this way is possible to create an SOS channel to receive alarms in every condition.
A big thank to the developers of this project that I found so useful.
@binwiederhier commented on GitHub (Jun 29, 2022):
You can do the overriding in the main settings. Go to Settings -> Channel settings". There you can override DND for the different priorities.
@inconis commented on GitHub (Jun 30, 2022):
Hi, thanks for your answer. Probably I explained in a bad way what I meant. With the app, "WirePusher" is possible to redirect the stream to "alarm stream" in this way if I put my phone in silent mode I can still receive the sound of the notification.
This function can be really useful for example to receive some "urgent" notifications.
@binwiederhier commented on GitHub (Nov 19, 2022):
See also #404
@doits commented on GitHub (Nov 30, 2022):
Maybe this could be implemented by creating custom notification channels when enabled for a subscription, like toggling a setting "Custom notification channels for this subscription".
Currently there are 5 default notification channels (min to max). If the setting was toggled for a specific subscription, it could add 5 more notification channels for the specific channel. Then you could set the notification sound etc. within the android app settings, even override DND, like it is now possible for the 5 default notification channels.
Another way (or in addition) maybe you could create custom notification channels globally in the ntfy app settings and then assign a subscription to that notification channel. E.g. in settings you create a channel called "X" and ntfy would create 5 notification channels for "X", one for each priority (min to max). This way you could put multiple subscriptions into the same custom notification channel (not sure if this is needed).
@binwiederhier commented on GitHub (Dec 4, 2022):
@doits This is an incredibly smart idea. And I love that you even provided an implementation for it. I would even go so far as to just create a notification channel for every subscription by default. I'm gonna have a look at the code today if I can.
@binwiederhier commented on GitHub (Dec 4, 2022):
Okay, upon thinking about it, having a custom channel for each subscription by default is not going to work, because then the priority-channels would be irrelevant. It's kind of a tricky one. I think if we were to make this a thing, it'd have to be opt-in like you suggested:
With these channels:
I think adding multiple "per-priority channels" for each topic (like you implemented) is overkill.
@binwiederhier commented on GitHub (Dec 4, 2022):
Alright ... So I should have thought about the whole thing and maybe even tried it before commenting. I do think that maybe your approach is actually the correct one. Otherwise you'd essentially take away the ability to have low/high-priority messages when this is enabled.
So what you implemented is this:
While this seems like the only approach that achieves "infinite flexibility", it also seems like absolute configuration overkill. Say I have 5 subscriptions, that means I now have 25 channels if I enable the feature on a subscription. Doing a simple thing, like changing the notification sound, now becomes an awful chore.
@doits commented on GitHub (Dec 4, 2022):
Thanks for your review and your feedback. Your last comment is correct about I implemented it.
I also thought about only adding one channel per subscription (ignoring priority), but I felt this was an important feature of ntfy which should always be present.
While writing a response I thought about different variations and finally asked myself the question: What use case is solved by this? I think most of users want to change the notification sound for a subscription, not having to change the sound of 5 priorities (like you said). Changing the notification for each priority also has it's use case, but probably to fewer users.
So maybe this way is cleaner:
You have the setting ...
... and when you enable it, it creates one extra notification channel:
So by default, all priorities of this subscription go into this one channel.
In addition, it reveals 5 more settings (maybe they must be expanded first to be visible, or they are on a second "subscription notification page" etc.):
All are
OFFby default. Each toggle creates an extra notification channel just for this subscription and priority, so for example:... results in ...
So you can add specific notification channels per priority. If not, they go into the "Other priorities" channel of the subscription.
Finally, if you create a channel for each priority:
... it would result in channels like the current implementation ...
(no need for the "Other priorities" notification channel).
What do you think? Still too complicated?
@doits commented on GitHub (Dec 4, 2022):
A simplification could be to have the user only choose between three states:
So in essence you could only choose to have all 5 priority channels (
C) or one for all priorities (B), which would make the settings dialog simpler (only one list setting) and sacrifice only a little bit flexibility.@binwiederhier commented on GitHub (Dec 4, 2022):
Your suggestion in the last comment sounds fantastic and tackles all the issues I was worried about. However, option B is so incredibly counter-intiutive ("why does my min priority message still ring?", "why does my max priority message not vibrate like a maniac?") that it doesn't seem like it should exist.
So after all this discussion, I feel like what you have seems to be the right approach. Let's go with that! I still have not reviewed the code, but I will probably tonight.
@binwiederhier commented on GitHub (Dec 6, 2022):
FYI I still haven't reviewed it, and I'm too tired to do it tonight. I got held up by all that "Google rejecting the app" business (see #531 ...).
@doits commented on GitHub (Dec 6, 2022):
No problem, take the time you need. There's no push from my side.
@binwiederhier commented on GitHub (Dec 10, 2022):
I merged https://github.com/binwiederhier/ntfy-android/pull/49 and it'll be in the next release. Thank you @doits for all your work.
@doits commented on GitHub (Dec 10, 2022):
Glad it got merged and thanks for your review and your finishing up! Unfortunately I couldn't review your changes (couldn't find the time), but I'm sure it works out like it should :-)