How do I get ntfy.sh notifications to be clickable?
To make ntfy.sh notifications clickable, you can either set a 'click' action to make the entire notification a hyperlink or add up to three 'action bu...
Summary
To make ntfy.sh notifications clickable, you can either set a ‘click’ action to make the entire notification a hyperlink or add up to three ‘action buttons’ for distinct interactions like opening a URL, sending an HTTP request, or triggering an Android broadcast.
Action Buttons Overview
Action Buttons in ntfy.sh allow for adding rich, interactive elements to notifications. You can define up to three distinct user actions using either the X-Actions header (with aliases Actions or Action) in a cURL request or as a JSON array in the actions field when publishing JSON data. There are three supported action types: ‘view’, which opens a specified URL or app; ‘http’, which sends an HTTP request (POST by default) to a URL, useful for triggering webhooks or APIs; and ‘broadcast’, an Android-only feature that sends an Android broadcast intent, enabling integration with automation apps like Tasker. Each action can be customized with parameters like a label, URL, and other type-specific fields.
Curl Examples Header
Minimal clickable notification (opens URL on tap):
curl -H "Title: Build finished" \ -H "Click: https://example.com/build/123" \ -d "All tests passed" \ https://ntfy.sh/mytopic
Notification with ‘view’ and ‘http’ action buttons:
curl -H "Title: Door" \ -H "Actions: view, label=Open Cam, url=https://cam.local; http, label=Unlock, url=https://api.local/door, method=POST" \ -d "Visitor at the door" \ https://ntfy.sh/home
Notification with an Android automation ‘broadcast’ button:
curl -H "Title: Lights" \ -H "Actions: broadcast, label=Toggle, intent=io.heckel.ntfy.USER_ACTION, extras.room=living" \ -d "Toggle living room lights" \ https://ntfy.sh/home
Curl Examples Json
To send a clickable notification by publishing a JSON payload, you can use the ‘click’ field within the JSON object. The following curl command demonstrates this:
curl -H "Content-Type: application/json" \ -d '{ "topic": "mytopic", "title": "Build finished", "message": "All tests passed", "click": "https://example.com/build/123" }' \ https://ntfy.sh
Ios Support Status
The provided documentation does not contain any specific information regarding support for clickable notifications or action buttons on the iOS platform. The feature descriptions, implementation guides, and support matrices focus exclusively on Android and Web (desktop) clients.
Other Ideas