1.2 KiB
1.2 KiB
Push Notification Testing Findings (Jul 9, 2026)
iOS Safari: PushManager not available in browser tab
- Safari on iPhone does NOT expose
PushManagerin normal browsing mode FAIL: No PushManageris expected- User must install the PWA: Share icon -> Add to Home Screen
- Then open from home screen (fullscreen PWA mode)
- APNs endpoint:
https://web.push.apple.com/... - Chrome/Edge/Firefox on desktop work natively
Common bugs fixed:
- Banner hidden:
display:nonein HTML, JS must setstyle.display='block' - user_id NULL: Foreign key constraint on
push_subscriptions.user_idmeans test/no-auth subscriptions fail. Column must allow NULL or skip auth requirement on the subscribe endpoint - Silent failure:
send_push_notification()usedexcept: pass— changed to print the error - Import missing:
import jsonwas missing andwebpush()needs it forjson.dumps()payload - Wrong venv:
pywebpushmust be installed in the same venv the systemd service uses
Trigger flow for scoring pushes:
send_push_notification(user_id, title, body, icon)is called after score events- Currently only works for authed users with subscriptions
- No quiet hours check yet in the push function itself (only in settings toggle)