Notifications on iPhone: what a web app can do

For a long time, a web app could not notify an iPhone. Apple changed that with iOS 16.4. I state the constraint, then the solution, then the limit, with the official pages at the bottom. I promise no delivery time: it depends on the person’s iPhone and settings.

Théo BeltrameLead Developer Front-end (PWA), 2 min

Photo: Dennis Cortés cortes, CC0. Photo credits

What Apple announced in 2023

On February 16, 2023, the WebKit team published the beta of iOS and iPadOS 16.4 with one new feature: Web Push for web apps added to the home screen.

Before that version, the feature did not exist. Since then, three standard interfaces work together: the Push API, the Notifications API and Service Workers.

It is the same W3C standard that reached Safari 16.1 on macOS Ventura. No in-house system to learn.

The conditions on the iPhone side

First condition: iOS or iPadOS 16.4 at the least. Below that, nothing to do.

Second: the app has to be on the home screen. You go through Safari’s Share menu, then add it to the home screen. The app’s manifest declares a standalone or fullscreen display, otherwise it opens as a plain shortcut.

web.dev adds a detail that matters: on iOS, the browser offers no install prompt. The person has to make the gesture themselves. Hence the value of a step-by-step guide to send them.

The permission follows a gesture

The app can only ask for permission in response to a direct action, such as a tap on an “Turn on reminders” button. iOS then shows its system window.

In practice, no window when the app opens. The button lives in a settings screen, or right after a first finished session.

A refusal sticks. The person reverses it in the iPhone settings, not in the app.

Where the notification shows up

Apple lists the lock screen, the notification center and a paired Apple Watch. Focus modes apply too: a person who turned one on may see nothing. That is their choice.

Sending goes through the Apple Push Notification service. Apple states that you do not need to be a member of the Apple Developer Program to use it with a web app.

What I do not promise

The exact delay between sending and display. Apple’s article guarantees none, so I write none.

Android: this article follows Apple’s sources and does not cover that system.

If your app offers reminders, run this test this week: install it on your iPhone, tap the activation button, lock the screen and wait. You will see what your audience will see.

Sources