forked from mirrors/ntfy
Docs
This commit is contained in:
parent
ae1fb74ac6
commit
23a127d20b
3 changed files with 51 additions and 26 deletions
|
@ -2220,8 +2220,8 @@ Here's an example showing how to upload an image:
|
||||||
Host: ntfy.sh
|
Host: ntfy.sh
|
||||||
Filename: flower.jpg
|
Filename: flower.jpg
|
||||||
Content-Type: 52312
|
Content-Type: 52312
|
||||||
|
|
||||||
<binary JPEG data>
|
(binary JPEG data)
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "JavaScript"
|
=== "JavaScript"
|
||||||
|
@ -2354,69 +2354,97 @@ _Supported on:_ :material-android:
|
||||||
|
|
||||||
You can include an icon that will appear next to the text of the notification. Simply pass the `X-Icon` header or query
|
You can include an icon that will appear next to the text of the notification. Simply pass the `X-Icon` header or query
|
||||||
parameter (or its alias `Icon`) to specify the URL that the icon is located at. The client will automatically download
|
parameter (or its alias `Icon`) to specify the URL that the icon is located at. The client will automatically download
|
||||||
the icon (up to 300KB) and show it in the notification. Only jpeg and png images are supported at this time.
|
the icon (unless it is already cached locally, and less than 24 hours old), and show it in the notification. Icons are
|
||||||
|
cached locally in the client until the notification is deleted. **Only JPEG and PNG images are supported at this time**.
|
||||||
|
|
||||||
Here's an example showing how to include an icon:
|
Here's an example showing how to include an icon:
|
||||||
|
|
||||||
=== "Command line (curl)"
|
=== "Command line (curl)"
|
||||||
```
|
```
|
||||||
curl \
|
curl \
|
||||||
-X POST \
|
-H "Icon: https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png" \
|
||||||
-H "Icon: https://ntfy.sh/docs/static/img/ntfy.png" \
|
-H "Title: Kodi: Resuming Playback" \
|
||||||
ntfy.sh/customIcons
|
-H "Tags: arrow_forward" \
|
||||||
|
-d "The Wire, S01E01" \
|
||||||
|
ntfy.sh/tvshows
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "ntfy CLI"
|
=== "ntfy CLI"
|
||||||
```
|
```
|
||||||
ntfy publish \
|
ntfy publish \
|
||||||
--icon="https://ntfy.sh/docs/static/img/ntfy.png" \
|
--icon="https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png" \
|
||||||
customIcons
|
--title="Kodi: Resuming Playback" \
|
||||||
|
--tags="arrow_forward" \
|
||||||
|
tvshows \
|
||||||
|
"The Wire, S01E01"
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "HTTP"
|
=== "HTTP"
|
||||||
``` http
|
``` http
|
||||||
POST /customIcons HTTP/1.1
|
POST /tvshows HTTP/1.1
|
||||||
Host: ntfy.sh
|
Host: ntfy.sh
|
||||||
Icon: https://ntfy.sh/docs/static/img/ntfy.png
|
Icon: https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png
|
||||||
|
Tags: arrow_forward
|
||||||
|
Title: Kodi: Resuming Playback
|
||||||
|
|
||||||
|
The Wire, S01E01
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "JavaScript"
|
=== "JavaScript"
|
||||||
``` javascript
|
``` javascript
|
||||||
fetch('https://ntfy.sh/customIcons', {
|
fetch('https://ntfy.sh/tvshows', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Icon': 'https://ntfy.sh/docs/static/img/ntfy.png' }
|
headers: {
|
||||||
|
'Icon': 'https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png',
|
||||||
|
'Title': 'Kodi: Resuming Playback',
|
||||||
|
'Tags': 'arrow_forward'
|
||||||
|
},
|
||||||
|
body: "The Wire, S01E01"
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "Go"
|
=== "Go"
|
||||||
``` go
|
``` go
|
||||||
req, _ := http.NewRequest("POST", "https://ntfy.sh/customIcons", file)
|
req, _ := http.NewRequest("POST", "https://ntfy.sh/tvshows", strings.NewReader("The Wire, S01E01"))
|
||||||
req.Header.Set("Icon", "https://ntfy.sh/docs/static/img/ntfy.png")
|
req.Header.Set("Icon", "https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png")
|
||||||
|
req.Header.Set("Tags", "arrow_forward")
|
||||||
|
req.Header.Set("Title", "Kodi: Resuming Playback")
|
||||||
http.DefaultClient.Do(req)
|
http.DefaultClient.Do(req)
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "PowerShell"
|
=== "PowerShell"
|
||||||
``` powershell
|
``` powershell
|
||||||
$uri = "https://ntfy.sh/customIcons"
|
$uri = "https://ntfy.sh/tvshows"
|
||||||
$headers = @{ Icon="https://ntfy.sh/docs/static/img/ntfy.png" }
|
$headers = @{ Title"="Kodi: Resuming Playback"
|
||||||
Invoke-RestMethod -Method 'Post' -Uri $uri -Headers $headers -UseBasicParsing
|
Tags="arrow_forward"
|
||||||
|
Icon="https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png" }
|
||||||
|
$body = "The Wire, S01E01"
|
||||||
|
Invoke-RestMethod -Method 'Post' -Uri $uri -Headers $headers -Body $body -UseBasicParsing
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "Python"
|
=== "Python"
|
||||||
``` python
|
``` python
|
||||||
requests.put("https://ntfy.sh/customIcons",
|
requests.post("https://ntfy.sh/tvshows",
|
||||||
headers={ "Icon": "https://ntfy.sh/docs/static/img/ntfy.png" })
|
data="The Wire, S01E01",
|
||||||
|
headers={
|
||||||
|
"Title": "Kodi: Resuming Playback",
|
||||||
|
"Tags": "arrow_forward",
|
||||||
|
"Icon": "https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png"
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "PHP"
|
=== "PHP"
|
||||||
``` php-inline
|
``` php-inline
|
||||||
file_get_contents('https://ntfy.sh/customIcons', false, stream_context_create([
|
file_get_contents('https://ntfy.sh/tvshows', false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'method' => 'PUT',
|
'method' => 'PUT',
|
||||||
'header' =>
|
'header' =>
|
||||||
"Content-Type: text/plain\r\n" . // Does not matter
|
"Content-Type: text/plain\r\n" . // Does not matter
|
||||||
"Icon: https://ntfy.sh/docs/static/img/ntfy.png",
|
"Title: Kodi: Resuming Playback\r\n" .
|
||||||
]
|
"Tags: arrow_forward\r\n" .
|
||||||
|
"Icon: https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png",
|
||||||
|
],
|
||||||
|
'content' => "The Wire, S01E01"
|
||||||
]));
|
]));
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
Binaries for all releases can be found on the GitHub releases pages for the [ntfy server](https://github.com/binwiederhier/ntfy/releases)
|
Binaries for all releases can be found on the GitHub releases pages for the [ntfy server](https://github.com/binwiederhier/ntfy/releases)
|
||||||
and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/releases).
|
and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/releases).
|
||||||
|
|
||||||
<!--
|
|
||||||
|
|
||||||
## ntfy Android app v1.14.0 (UNRELEASED)
|
## ntfy Android app v1.14.0 (UNRELEASED)
|
||||||
|
|
||||||
**Features:**
|
**Features:**
|
||||||
|
@ -26,11 +24,10 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release
|
||||||
|
|
||||||
* Italian (thanks to [@Genio2003](https://hosted.weblate.org/user/Genio2003/))
|
* Italian (thanks to [@Genio2003](https://hosted.weblate.org/user/Genio2003/))
|
||||||
* Dutch (thanks to [@SchoNie](https://hosted.weblate.org/user/SchoNie/))
|
* Dutch (thanks to [@SchoNie](https://hosted.weblate.org/user/SchoNie/))
|
||||||
|
* Ukranian (thanks to [@v.kopitsa](https://hosted.weblate.org/user/v.kopitsa/))
|
||||||
|
|
||||||
Thank you to [@wunter8](https://github.com/wunter8) for proactively picking up some Android tickets, and fixing them! You rock!
|
Thank you to [@wunter8](https://github.com/wunter8) for proactively picking up some Android tickets, and fixing them! You rock!
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
## ntfy server v1.28.0 (UNRELEASED)
|
## ntfy server v1.28.0 (UNRELEASED)
|
||||||
|
|
||||||
**Features:**
|
**Features:**
|
||||||
|
|
BIN
docs/static/img/android-screenshot-icon.png
vendored
BIN
docs/static/img/android-screenshot-icon.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 28 KiB |
Loading…
Reference in a new issue