# Ship a PWA for iOS

> A source-backed iOS PWA checklist covering the manifest, Safari's Home Screen flow, display-mode detection, and notification permission.

Safari lets users add a PWA to the iOS Home Screen. Prepare its manifest and add-flow
instructions, detect the display mode, and request notification permission from a user action.
Permission alone does not complete a push subscription.

## Prepare the prerequisites

Start with a page you can open in Safari on an iPhone, and make sure you can edit its document
head and deploy static files beside it. Serve the notification example over HTTPS because MDN
marks `Notification.requestPermission()` as a secure-context feature. Prepare the icon files named
by the manifest, and keep an in-page updates view available before asking for notification
permission. That view is the usable path when the Notifications API is absent or the permission
result is `denied` or `default`.

## Platform support

Safari 26 on iOS 26 opens a site added to the Home Screen as a web app by default, while
the user can disable **Open as Web App** to create a bookmark. WebKit documents Web Push
for Home Screen web apps on iOS and iPadOS 16.4.

WebKit states that Safari 26 has no installability requirements on iOS 26 and iPadOS 26: any site can be added to the Home Screen and opened as a web app. A manifest still supplies benefits such as the icons Safari uses when they are declared. Treat the manifest checks below as control over the installed experience, not as a test of whether Safari exposes the add flow.

## Provide a manifest

A web app manifest supplies installation metadata such as the app name and icons. The
`display` member expresses a preferred display mode, and `start_url` is a hint that a
browser may ignore. Safari 26 uses manifest icons when they are present.

```json
{
  "name": "Field Notes",
  "short_name": "Notes",
  "start_url": "/",
  "display": "standalone",
  "icons": [
    { "src": "/icons/notes-192.png", "sizes": "192x192", "type": "image/png" },
    { "src": "/icons/notes-512.png", "sizes": "512x512", "type": "image/png" }
  ]
}
```

Link the manifest from the document head with
`<link rel="manifest" href="/manifest.webmanifest">`.

Check the actual deployment with this Python 3 command. Replace the example URL first.
It fails on HTTP errors, an unexpected response type, invalid JSON, or missing fields used by
this checklist. The PASS line shows what to expect when your deployment passes these checks.

```sh
# Replace the URL with your deployed manifest; requires Python 3.
python3 - https://example.com/manifest.webmanifest <<'PYTHON'
import json, sys, urllib.request
with urllib.request.urlopen(sys.argv[1], timeout=15) as response:
    assert response.status == 200, f"HTTP {response.status}"
    content_type = response.headers.get_content_type()
    assert content_type in ("application/manifest+json", "application/json"), content_type
    manifest = json.load(response)
    assert isinstance(manifest, dict), "Expected a JSON object"
    assert manifest.get("display") == "standalone", "Check display"
    assert manifest.get("start_url"), "Missing start_url"
    assert manifest.get("icons"), "Missing icons"
print("PASS: manifest response and checklist fields")
PYTHON
```

If it fails, inspect the error before testing installation: an HTML response often means the
URL reached a page fallback; a missing field means the deployed file differs from the manifest
above. This checks the response and selected fields only. Open each icon URL separately, then
perform the Home Screen test below; this script does not prove installability or offline support.

Run this second check against the same manifest URL to verify that each declared icon returns HTTP
200 with an image media type. Its PASS line is illustrative output from the script, not a recorded
result for `example.com`.

```sh
python3 - https://example.com/manifest.webmanifest <<'PYTHON'
import json, sys, urllib.parse, urllib.request
with urllib.request.urlopen(sys.argv[1], timeout=15) as response:
    manifest = json.load(response)
    manifest_url = response.url
for icon in manifest.get("icons", []):
    icon_url = urllib.parse.urljoin(manifest_url, icon["src"])
    with urllib.request.urlopen(icon_url, timeout=15) as icon_response:
        assert icon_response.status == 200, f"Icon HTTP {icon_response.status}"
        media_type = icon_response.headers.get_content_type()
        assert media_type.startswith("image/"), f"{icon_url}: {media_type}"
print("PASS: declared icons return image responses")
PYTHON
```

An HTTP error identifies an icon URL that did not return successfully. A printed media type in an
assertion identifies a successful response that is not labelled as an image. Fix that resource
before testing the Home Screen icon.

## Explain the Safari add flow

Apple's iPhone guide instructs the user to open Safari's Share menu, choose **Add to Home
Screen**, turn on **Open as Web App**, and choose **Add**. Present those instructions when
the document is not in standalone display mode.

After the user chooses **Add**, expect the site's icon to appear on the Home Screen. With **Open
as Web App** enabled, tapping that icon opens the site as a web app; if the switch is disabled,
Apple's flow creates a bookmark instead.

## Request notification permission from an action

WebKit states that a Home Screen web app on iOS or iPadOS 16.4 must request Web Push
permission in response to direct user interaction. MDN likewise places `Notification.requestPermission()`
in a click handler. Permission is one step; WebKit describes standards-based Web Push as
the Push API, Notifications API, and Service Workers working together.

Expect the permission Promise to produce `granted`, `denied`, or `default`. Continue to the Push
API subscription work only after `granted`; for either other result, leave the in-page updates
view visible and do not describe push as enabled.

## Examples

These complete pages cover the display-mode branch and the permission branch. Both keep a
visible fallback when the tested capability or state is absent.

### Show the Safari instruction outside standalone mode

Use the `display-mode` media feature to hide the instruction in standalone
mode. In every other display mode, the documented Safari route stays visible.

```html
<!doctype html>
<html lang="en">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Install Field Notes</title>
  <p id="install-hint">In Safari, use Share, then Add to Home Screen.</p>
  <script>
    const installHint = document.querySelector('#install-hint');
    const standalone = window.matchMedia('(display-mode: standalone)').matches;

    if (standalone) {
      installHint.hidden = true;
    } else {
      installHint.hidden = false;
    }
  </script>
</html>
```

MDN notes that display mode does not directly prove installation status, so this example
uses it only to decide whether the instruction belongs in the current view.

### Handle missing or denied notification permission

Report only the permission result. The failure path is visible in the status paragraph: if the
Notifications API is absent, or if the user denies or dismisses the prompt, the page continues to
say that updates remain available in the app. Keep that route available and do not retry the
permission request during page load.

```html
<!doctype html>
<html lang="en">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Field Notes notification permission</title>
  <button id="permission" type="button">Request notification permission</button>
  <p id="status" aria-live="polite">Updates are available in the app.</p>
  <section id="updates"><h2>Updates</h2><p>Demo update: the app is ready to test.</p></section>
  <script>
    const status = document.querySelector('#status');

    document.querySelector('#permission').addEventListener('click', async () => {
      if (!('Notification' in window)) {
        status.textContent = 'Updates remain available in the app.';
        return;
      }

      let permission;
      try {
        permission = await Notification.requestPermission();
      } catch {
        status.textContent = 'Permission request failed. Read the Updates section below.';
        return;
      }
      if (permission === 'granted') {
        status.textContent = 'Notification permission granted.';
      } else {
        status.textContent = 'Updates remain available in the app.';
      }
    });
  </script>
</html>
```

The success text does not claim that push is enabled; the example does not create a Push
API subscription.

:::caution
WebKit requires the Web Push permission request on iOS and iPadOS 16.4 to follow direct
user interaction. Do not call it during page load.
:::

The Updates section contains a static demo item and remains readable after permission is denied or the API is unavailable. Replace
it with your own application data before shipping. Test with the API absent, permission denied,
and permission granted; only the permission status should change.

## Compare with the recorded iOS test

The [notification field notes](/guides/field-notes-ios-notifications/) document one iPhone 16 Pro
running iOS 18.6.2. They link the recorded data and explain how to check permission, subscription
objects, and notification clicks separately. That run did not deliver a remote push and does not
establish behaviour on other releases. Use its procedure on your target device and record the
result. Test remote push delivery separately after checking permission and subscription.

## See also

- [Turn a website into an app in Safari on iPhone (Apple Support)](https://support.apple.com/guide/iphone/open-as-web-app-iphea86e5236/ios)
- [Web Push for Web Apps on iOS and iPadOS (WebKit)](https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/)
- [Make it installable](/guides/installable/)
- [PWAs on iOS and Safari](/reference/platforms/ios-safari/)
- [iOS Add to Home Screen](/reference/installation/ios-add-to-home-screen/)
- [Browser compatibility data](/compatibility/)