Skip to Content
Platform.Ontology

Notification service extension and mutable content

A small helper that edits an iOS push for about 30 seconds before it is shown.

Works without askingNotifications and backgroundPermission and presentationAndroid and iPhoneIn the background

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

AndroidiPhone
StatusSupportedSupported
First versionAndroid 1.0 (API 1)iOS 10.0
Permission or entitlementNot listedUNNotificationServiceExtension; aps mutable-content 1 with an alert
Protection levelnoneentitlement
How access is grantedinstallinstall
What the user seesNoneNone
How long it lastsData 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 backn/an/a
Store policyNone listedApp Review: extension used only to improve notifications
APIFirebaseMessagingService.onMessageReceived()UNNotificationServiceExtension.didReceive, serviceExtensionTimeWillExpire()
NotesMust finish quickly or hand off to WorkManager; for v2 RemoteNotification a 20 s windowAbout 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

FieldTypeUnitRangePrecision
windowintegersecondsabout 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

TypeExampleApps
messagingA secure chat app decrypts the message on your phone so the server never sees the text.Signal, WhatsApp
deliveryA courier app downloads a photo of your doorstep and attaches it to the alert.Amazon
newsA news app adds a thumbnail to the headline alert.NYT
socialA social app swaps in the sender's current profile photo.Instagram
adsA marketing tool records that the alert reached the phone before you even saw it.None named
bankingA bank app shows your balance in the alert after fetching it securely.None named
gamesA 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

Good uses and abuse

Legitimate uses

  • End to end encrypted messaging
  • Rich previews

Known abuse

  • Beaconing from the extension before display

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction1 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2016-09, iPhone iOS 10: Notification service extension introduced

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.

On this page