1.6 KiB
1.6 KiB
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority |
|---|---|---|---|---|---|---|---|---|
| task-3 | Add push notifications | Done | 2025-12-15 19:37 | 2026-01-02 14:27 | medium |
Description
Implement web push notifications for friend arrivals, proximity alerts, and group activity. Include battery-friendly polling options.
Implementation Notes
Implementation
Implemented comprehensive push notification system:
-
Web Push with VAPID (
sync-server/server.js)- VAPID key authentication for secure push
- Push subscriptions stored per room
- Silent push for location requests
- Notification push for friend joins/meeting points
-
Service Worker (
public/sw.js)- Handles push events
- Silent push triggers location update via postMessage
- Notification push shows native notifications
- Click handling opens room URL
-
Push Hooks (
src/hooks/usePushNotifications.ts)- Subscribe/unsubscribe to push notifications
- Auto-subscribes when joining room
- Handles VAPID public key fetching
-
Location Request System
- "Ping all" button with bell icon in friends list header
- Individual ping button per participant
- Deduplicates by name (only pings one session per user)
- WebSocket for online clients, push for offline
-
Background Location Sync
- Automatic periodic location requests (60s interval)
- Service worker messages for location sync
- Background Sync API integration