# iOS smoke test

The one check no automated test in this repository can make. The
browser drive proves the module, the worker import and the handlers
agree in Chromium with a subscription double; Chromium's own push
subscription cannot be pointed at a test service, and iOS cannot be
driven at all. So this is a person, a phone, and ten minutes, run
before a release that touches the JS halves or the handlers.

**Last run:** not yet. Record the date, iOS version and outcome at
the bottom when it is.

## Setup

1. Deploy the example (or any app wired per `SKILL.md`) at an https
   origin the phone can reach. `http://localhost` is a secure context
   on the machine itself, not across a network; use a real origin or
   a tunnel that terminates TLS.
2. Provision the key once and keep it across restarts:
   `EXAMPLE_VAPID_PRIVATE_KEY="$(cat .vapid-key)"`.
3. iPhone or iPad on iOS/iPadOS 16.4 or later, in Safari.

## Steps and expected outcomes

1. **Open the origin in Safari.** The page loads; the coaching
   paragraph about the Home Screen is visible; the buttons are
   disabled (Safari-in-browser reports `push: false` on iOS, so the
   log says the browser cannot do push).
2. **Share → Add to Home Screen. Open the installed copy.** The
   coaching paragraph is hidden (`standalone` true); after the worker
   activates, the buttons are enabled; the log shows `subscribed:
   false`.
3. **Tap Enable.** iOS shows its permission prompt (it must come from
   the tap — if no prompt appears, the gesture was lost). Allow. The
   log shows `enabled: https://web.push.apple.com/…`. On the server,
   one row for `dev`.
4. **Tap Notify me.** A notification appears in the system tray with
   the title "Hello from aviso" while the app is in the foreground and
   again after backgrounding the app and tapping Notify from another
   device or a curl to `/notify`.
5. **Tap the notification.** The installed app comes to the front at
   `/` (the payload's `url`).
6. **Tap Disable.** The log shows `disabled`; the server has zero
   rows. Close the app fully and reopen it: the log shows `subscribed:
   false` and the server still has zero rows — reconcile must not
   re-enrol after an opt-out.
7. **Tap Enable again, then rotate the key on the server** (new
   `EXAMPLE_VAPID_PRIVATE_KEY`, restart). Reopen the app: reconcile
   re-subscribes under the new key without a prompt, and Notify
   delivers again.
8. **Remove the app from the Home Screen.** The next send reports 410
   from Apple's push service and the row is pruned.

## Recording a run

| Date | iOS | Device | Steps passed | Notes |
|------|-----|--------|--------------|-------|
|      |     |        |              |       |
