home-assistant / home-assistant/iOS

Attachment is downloaded at delivery but no thumbnail is shown on the collapsed notification

Open
#5,802 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
2.4k
Forks
520
Avg merge
7h 27m
Merged PRs (30d)
264

Description

> Not a frontend issue — this is about push notification attachments, so the
> Safari check in the template does not apply.

**Describe the bug**

An image attachment is never shown as a thumbnail on the collapsed
notification. The image only becomes visible after long-pressing / expanding
the notification. Per the documentation, `hide-thumbnail` defaults to false,
so a thumbnail should be shown on the collapsed notification.

The attachment itself is fine and arrives in time. I instrumented the image
URL with a unique token per test and watched the access log of the host
serving it: the app downloads the file about five seconds after delivery,
without any interaction, and never requests it again. By the time the banner
is displayed the file is already on the device — it is simply not presented
as a thumbnail.

**To Reproduce**

Send a notification with an image attachment, e.g. the minimal example from
the docs, using Home Assistant's own static icon so nothing external is
involved:

```yaml
action: notify.mobile_app_
data:
title: "Test"
message: "Test"
data:
attachment:
url: /static/icons/favicon-192x192.png
```

The notification arrives, no thumbnail is shown on the collapsed
notification, and the image appears only when the notification is expanded.

**What I already ruled out**

| Variant tested | Result |
| --- | --- |
| `hide-thumbnail: false` explicitly vs. omitted (default) | no difference |
| `data.image` additionally set vs. `attachment` only | no difference |
| Wide image (1000×520 PNG, ~50 KB) vs. square (192×192 PNG, ~4 KB) | no difference |
| Image from my own server (absolute URL) vs. from Home Assistant (relative path) | no difference |
| Full payload (`tag`, `push.interruption-level`, `content-type`) vs. minimal payload with only `attachment.url` | no difference |
| URL with query string vs. clean `.png` path | no difference |

Download timing, measured on the host serving the image with a unique URL per
test while the phone was left untouched:

```
t+0s 0 requests
t+5s 1 request <- at delivery, without any interaction
t+10s 1
t+25s 1 <- no second request when expanding later
```

So the attachment is fetched once at delivery and is not loaded lazily on
expand.

Device side, all checked:

- Show Previews: **Always**
- Notification display style: **List**
- All notification options enabled for the Home Assistant app
- No Focus mode active

**Expected behavior**

A thumbnail of the attachment on the collapsed notification. The
documentation describes `hide-thumbnail` as suppressing it ("the thumbnail
will not show on the notification. The content will only be viewable by
expanding"), which implies the default shows one, and the dynamic attachment
docs state that "the preview thumbnail of the notification will display a
still image from the camera".

**Screenshots**

Happy to add if useful — the collapsed notification simply shows title and
text with no image area.

**Device details**

- Model Name: iPhone 17 Pro
- Software Version: iOS 27.0
- App version: 2026.9.1

**Home Assistant version**

Core 2026.8.1

**Additional context**

This may be the same underlying problem as #3004 (open since September 2024,
snapshots/thumbnails no longer shown in notifications). That report involves
camera snapshots; my case has no camera at all and uses a plain static PNG,
which might make it easier to reproduce.

There is also an old precedent in #39, which had the same symptom and was
traced to the attachment identifier being derived from
`attachmentURL.lastPathComponent` — per Apple's documentation that "doesn't
work for urls" — so the identifier was not passed correctly between the
Notification Service Extension (which downloads) and the Notification Content
Extension (which displays). From the outside the behaviour here looks the
same: the file is downloaded and rendered on expand, but iOS never receives a
usable attachment for the banner thumbnail.

Contributor guide

Open the contributing guide

Research direction

Reproduce the YAML notification with an image attachment, then trace how the Notification Service Extension passes the downloaded file to the Notification Content Extension. Compare the attachment identifier handling with the precedent in #39 and verify that the image appears on the collapsed notification while preserving the documented hide-thumbnail behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.