ntfy.sh | simple HTTP-based pub-sub
+ ntfy.sh | simple HTTP-based pub-sub
- Ntfy (pronounce: notify) is a simple HTTP-based pub-sub notification service. - It allows you to send notifications to your phone or desktop via scripts from any computer, - entirely without signup or cost. It's also open source if you want to run your own. + ntfy (pronounce: notify) is a simple HTTP-based pub-sub notification service. + It allows you to send notifications to your phone or desktop via scripts from any computer, + entirely without signup, cost or setup. It's also open source if you want to run your own.
- -- There are many ways to use Ntfy. You can send yourself messages for all sorts of things: When a long process finishes or fails, - or to notify yourself when somebody logs into your server(s). Or you may want to use it in your own app to distribute messages to subscribed clients. - Endless possibilities 😀. Be sure to check out the examples below. + There are many ways to use it: Notify yourself when a build finishes, when an rsync is done or a backup fails, + or know when somebody logs into your server. There are many more examples, endless possibilities 😀.
Publishing messages
@@ -64,16 +62,16 @@ Because there is no sign-up, the topic is essentially a password, so pick something that's not easily guessable.- Here's an example showing how to publish a message using curl (via POST): + Here's an example showing how to publish a message using a POST request (via curl -d):
curl -d "Backup successful 😀" ntfy.sh/mytopic
- And another one using PUT: + And another one using PUT (via curl -T):
- echo -en "\u26A0\uFE0F Unauthorized login" | curl -sT- ntfy.sh/mytopic
+ echo -en "\u26A0\uFE0F Unauthorized login" | curl -T- ntfy.sh/mytopic
Here's an example in JS with fetch() (see full example): @@ -200,7 +198,7 @@
Examples
- There are a million ways to use Ntfy, but here are some inspirations. I try to collect + There are a million ways to use ntfy, but here are some inspirations. I try to collect examples on GitHub, so be sure to check those out, too.
@@ -220,7 +218,7 @@Example: Server-sent messages in your web app
- Just as you can subscribe to topics in this Web UI, you can use Ntfy in your own + Just as you can subscribe to topics in this Web UI, you can use ntfy in your own web application. Check out the live example or just look the source of this page.
@@ -302,9 +300,24 @@ is to facilitate instant notifications on Android. +
+ How much battery does the Android app use?
+ If you use the ntfy.sh server and you don't use the instant delivery feature, the Android app uses no
+ additional battery, since Firebase Cloud Messaging (FCM) is used. If you use your own server, or you use
+ instant delivery, the app has to maintain a constant connection to the server, which consumes about 4% of
+ battery in 17h of use (on my phone). I use it and it makes no difference to me.
+
+ What is instant delivery?
+ Instant delivery is a feature in the Android app. If turned on, the app maintains a constant connection to the
+ server and listens for incoming notifications. This consumes additional battery,
+ but delivers notifications instantly.
+
Why is there no iOS app (yet)?
- I don't have an iPhone or a Mac, so I didn't make an iOS app yet. I'd be awesome if
+ I don't have an iPhone or a Mac, so I didn't make an iOS app yet. It'd be awesome if
someone else could help out.