| 1 | # iOS smoke test |
| 2 | |
| 3 | The one check no automated test in this repository can make. The |
| 4 | browser drive proves the module, the worker import and the handlers |
| 5 | agree in Chromium with a subscription double; Chromium's own push |
| 6 | subscription cannot be pointed at a test service, and iOS cannot be |
| 7 | driven at all. So this is a person, a phone, and ten minutes, run |
| 8 | before a release that touches the JS halves or the handlers. |
| 9 | |
| 10 | **Last run:** not yet. Record the date, iOS version and outcome at |
| 11 | the bottom when it is. |
| 12 | |
| 13 | ## Setup |
| 14 | |
| 15 | 1. Deploy the example (or any app wired per `SKILL.md`) at an https |
| 16 | origin the phone can reach. `http://localhost` is a secure context |
| 17 | on the machine itself, not across a network; use a real origin or |
| 18 | a tunnel that terminates TLS. |
| 19 | 2. Provision the key once and keep it across restarts: |
| 20 | `EXAMPLE_VAPID_PRIVATE_KEY="$(cat .vapid-key)"`. |
| 21 | 3. iPhone or iPad on iOS/iPadOS 16.4 or later, in Safari. |
| 22 | |
| 23 | ## Steps and expected outcomes |
| 24 | |
| 25 | 1. **Open the origin in Safari.** The page loads; the coaching |
| 26 | paragraph about the Home Screen is visible; the buttons are |
| 27 | disabled (Safari-in-browser reports `push: false` on iOS, so the |
| 28 | log says the browser cannot do push). |
| 29 | 2. **Share → Add to Home Screen. Open the installed copy.** The |
| 30 | coaching paragraph is hidden (`standalone` true); after the worker |
| 31 | activates, the buttons are enabled; the log shows `subscribed: |
| 32 | false`. |
| 33 | 3. **Tap Enable.** iOS shows its permission prompt (it must come from |
| 34 | the tap — if no prompt appears, the gesture was lost). Allow. The |
| 35 | log shows `enabled: https://web.push.apple.com/…`. On the server, |
| 36 | one row for `dev`. |
| 37 | 4. **Tap Notify me.** A notification appears in the system tray with |
| 38 | the title "Hello from aviso" while the app is in the foreground and |
| 39 | again after backgrounding the app and tapping Notify from another |
| 40 | device or a curl to `/notify`. |
| 41 | 5. **Tap the notification.** The installed app comes to the front at |
| 42 | `/` (the payload's `url`). |
| 43 | 6. **Tap Disable.** The log shows `disabled`; the server has zero |
| 44 | rows. Close the app fully and reopen it: the log shows `subscribed: |
| 45 | false` and the server still has zero rows — reconcile must not |
| 46 | re-enrol after an opt-out. |
| 47 | 7. **Tap Enable again, then rotate the key on the server** (new |
| 48 | `EXAMPLE_VAPID_PRIVATE_KEY`, restart). Reopen the app: reconcile |
| 49 | re-subscribes under the new key without a prompt, and Notify |
| 50 | delivers again. |
| 51 | 8. **Remove the app from the Home Screen.** The next send reports 410 |
| 52 | from Apple's push service and the row is pruned. |
| 53 | |
| 54 | ## Recording a run |
| 55 | |
| 56 | | Date | iOS | Device | Steps passed | Notes | |
| 57 | |------|-----|--------|--------------|-------| |
| 58 | | | | | | | |
| 59 | |