Skip to content

Mobile Client and Live Telemetry

GiZano edited this page Aug 5, 2026 · 1 revision

Mobile Client & Live Telemetry

Built with React Native and Expo, the client serves as the primary EEW notification interface.

Real-Time Alerting (WebSockets)

  • Connection: Maintains a persistent WebSocket to /ws/alerts, authenticated via MOBILE_WS_TOKEN with exponential backoff.
  • Native Haptics & Notifications: "CRITICAL" payloads trigger an SOS vibration pattern and schedule a high-priority system push notification (AndroidImportance.MAX).

Telemetry Visualization

  • Data Fetching: Standard REST operations are managed by TanStack Query for automatic caching and background refetching.
  • Live Seismograph: Uses victory-native to render a dynamic line chart of aggregated seismic activity.
  • Geospatial Map: react-native-maps displays custom markers based on exact PostGIS coordinates, colored by active/offline status.
  • AI Report Banner: COMPLETED reports are rendered as a highlighted banner (summary + recommendations) for the latest alert, with an "AI Report Unavailable" badge on failures — see the AI Emergency Report Service.

Resilience (Zustand)

  • Alert Store: useAlertStore maintains a rolling history of the 10 most recent alerts.
  • Offline Mode: usePreferencesStore controls an "Offline Mode" that intentionally closes WebSockets and disables React Query polling to conserve battery.

Clone this wiki locally