mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #134] Add action buttons to notifications to allow for user response to ntfy message #109
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#109
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 @mrherman on GitHub (Feb 8, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/134
Add the ability to add clickable responses to a ntfy message. This is allowed in android notifications (called notification actions: https://developer.android.com/training/notify-user/build-notification.html#Actions). To make it consistent across all the ways to view a message I think it would also need to be added to the ntfy app's list of messages (adding clickable buttons under the message) and to web push notifications.
The action taken when a button is pushed could be a message published on a topic determined by a header set in the original notification and text indication which button. In this way the server that sent the actionable notification can just listen on a determined topic for a reply and to take action. The number of buttons and their text could be set in the same way.
Action buttons in a android notification (concept):

@s-h-a-r-d commented on GitHub (Apr 8, 2022):
Would love to have this feature.
Not sure how it is implemented but HomeAssistant has a feature like that: https://companion.home-assistant.io/docs/notifications/actionable-notifications/
Maybe the client does a POST to the server?
@binwiederhier commented on GitHub (Apr 15, 2022):
I'm going to work on this next. I am still brainstorming, but this is the idea so far:
My thoughts are that I can provide a limited syntax via HTTP headers, and then if you really want to pass more details, you can pass the message as JSON (https://ntfy.sh/docs/publish/#publish-as-json), something like
@s-h-a-r-d commented on GitHub (Apr 16, 2022):
Let us know if you need any help testing
@binwiederhier commented on GitHub (Apr 22, 2022):
📢 User actions: Request for testing
How to test
Server:
ntfy serve --cache-file cache.db(a db upgrade is required, so you may want to not use your prod db)Android:
Then navigate to
https://<testserver>/docs/publish/#action-buttonsand play with it.@binwiederhier commented on GitHub (Apr 22, 2022):
@s-h-a-r-d @mrherman This is ready for testing :-D
@binwiederhier commented on GitHub (Apr 23, 2022):
📢 Updated test binaries:
Server:
wget -O ntfy-actions-amd64 "https://phil.nopaste.net/t7XjlVBntr?d=1&f=ntfy&a=qsyn9vej8g"APK:
@binwiederhier commented on GitHub (Apr 23, 2022):
Will be in the next release