Notification service extension and mutable content
A small helper that edits an iOS push for about 30 seconds before it is shown.
In one line
Can edit an iPhone push for about 30 seconds before you see it
A small helper that edits an iOS push for about 30 seconds before it is shown.
Lets a company decrypt message text, fetch images and personalize on the phone. Android does the same inside the messaging service; both give short windows to run code.
What it can and can't do
What the user does: Nothing. It happens when a push arrives and before the alert shows
It can
- Download a picture or attach media before the alert shows
- Change the title or text, for example to decrypt a message
- Add details quickly, or hand longer work to a background job on Android
It cannot
- Run for more than about 30 seconds
- Run for silent, sound only or badge only pushes on iPhone
- Run when alerts are off for the app
- Work on Android with a long window; it must finish quickly
How it differs between platforms: iPhone has a service extension with about 30 seconds. Android must finish quickly or hand off to a background job.
On Android and iPhone
| Android | iPhone | |
|---|---|---|
| Status | Supported | Supported |
| First version | Android 1.0 (API 1) | iOS 10.0 |
| Permission or entitlement | Not listed | UNNotificationServiceExtension; aps mutable-content 1 with an alert |
| Protection level | none | entitlement |
| How access is granted | install | install |
| What the user sees | None | None |
| How long it lasts | Data messages run onMessageReceived in a short window (about 10 s before the system may kill the work) | Original content shown if the extension fails or time runs out |
| How to take it back | n/a | n/a |
| Store policy | None listed | App Review: extension used only to improve notifications |
| API | FirebaseMessagingService.onMessageReceived() | UNNotificationServiceExtension.didReceive, serviceExtensionTimeWillExpire() |
| Notes | Must finish quickly or hand off to WorkManager; for v2 RemoteNotification a 20 s window | About 30 s to modify the payload; does not run for silent, sound-only or badge-only payloads or if alerts are disabled |
Data you get
What comes back: Modification window
Shape: event
How often: Per push
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
window | integer | seconds | about 30 (iOS), 10 to 20 (Android) | approx |
Technical limits
- iOS extension does not run for silent pushes
- Short run window
The story
What it is
A tiny helper that edits an iPhone alert for about 30 seconds before you see it.
For you
You see a finished alert, such as a message that was scrambled in transit and shown as readable text. You never see the helper work in that short window.
For makers
Makers use it for end to end encrypted chats, previews and personal touches. The helper also runs code before display, so some use it to send a signal that the alert arrived.
Where you see it
| Type | Example | Apps |
|---|---|---|
| messaging | A secure chat app decrypts the message on your phone so the server never sees the text. | Signal, WhatsApp |
| delivery | A courier app downloads a photo of your doorstep and attaches it to the alert. | Amazon |
| news | A news app adds a thumbnail to the headline alert. | NYT |
| social | A social app swaps in the sender's current profile photo. | |
| ads | A marketing tool records that the alert reached the phone before you even saw it. | None named |
| banking | A bank app shows your balance in the alert after fetching it securely. | None named |
| games | A game builds a personal alert like Your farm is ready, Sam. | None named |
Risks
- Can report that an alert arrived
- Runs code before you see anything
Android and iPhone in short
- Android: Android does the same inside the messaging service with a short time window.
- iPhone: About 30 seconds. It does not run for silent pushes or when alerts are off.
What the platform says
- Apple: Modifying content in newly delivered notifications. Apple lets apps change an alert on arrival, for example to decrypt text or attach a picture.
Good uses and abuse
Legitimate uses
- End to end encrypted messaging
- Rich previews
Known abuse
- Beaconing from the extension before display
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2016-09, iPhone iOS 10: Notification service extension introduced
Related capabilities
Related
- Rich notification media attachments. Can attach pictures, sound or video to an iPhone alert, within size limits
- APNs delivery: payload, priority, expiration, collapse. Can send alerts to an iPhone through Apple, up to 4 KB of data per message
Same idea on the web
- Notifications. Can show messages on your screen outside the browser tab, once you tap Allow
Sources
How well checked: Checked against real behavior.