PL EN UA
← All 7 AI & n8n Case Studies
Automated Car Trip Telemetry (iOS, CarPlay & Apple Shortcuts) + Supabase Realtime
SWIFT • APPINTENTS • CARPLAY • APPLE SHORTCUTS • SUPABASE REALTIME
iOS Swift • CarPlay

Automated Car Trip Telemetry (iOS, CarPlay & Apple Shortcuts) + Supabase Realtime

Resilient Swift state machine (AppIntents + Darwin Notifications) eliminating fragmented trips on CarPlay drops, featuring a 30s–5m grace window, ≥ 15 km/h motion guard, Live Activity & Supabase Realtime.

30s–5m
Configurable grace window (180s default vs old 20s drop)
≥ 15 km/h
Auto-deferral (+30s) while vehicle remains in motion
0 klików
Hands-free background lifecycle, Live Activity & Supabase sync
Industry
Automotive / Mobile Engineering & Personal Automation (Smart Mobility)
Verification Status
Built and shipped (Build 8) via TestFlight CLI — verified in daily wired & wireless SmartBox CarPlay driving
My Role
System architecture, Swift AppIntents & background state-machine implementation, Apple Shortcuts automation design, Live Activities & Supabase Realtime sync.

01 // INTERACTIVE N8N DATA PIPELINE ARCHITECTURE

Animated workflow topology & node execution order

Drag any node to bend workflow links
Step 1 & 2: Shortcuts / AppIntents → Darwin Notifications → TripTrackerService (1 Hz + ≥ 15 km/h Guard)
1 CarPlay / Apple Shortcuts → 2 CarPlayDisconnectedIntent → 3 App Group + Darwin Notify → 4 TripTrackerService (1 Hz) → 5 30s–5m Grace & ≥ 15 km/h → 6 Cancel on Reconnect / Save
Step 3: Live Activity, Multilingual Settings UI (PL/EN/UK), Supabase Realtime & TestFlight (Build 8)
1 ActivityKit Live Activity → 2 CoreLocation GPS & SwiftData → 3 AppSettings (PL / EN / UK) → 4 Layer 2 Trip Lock → 5 Supabase Realtime WebSocket → 6 Xcode Cloud / TestFlight Build 8

02 // LIVE SYSTEM & OUTPUT SCREENSHOTS (CLICK TO ZOOM)

Real CRM tables, Klaviyo lists & automated Telegram alerts

DEMO // Live iOS / CarPlay Demo: active background GPS tracking, Dynamic Island Live Activity & seamless disconnect grace-window recovery

03 // Business Context & Bottleneck

  • • Premature trip termination: standard Shortcuts automation (When CarPlay Is Disconnected → Stop Trip) and a short 20-second timeout immediately split a single journey into fragments on transient CarPlay or wireless SmartBox drops.
  • • Lost mileage continuity while driving: reconnecting a cable or rebooting a wireless CarPlay dongle takes 30 seconds to several minutes, halting GPS logging even at highway speeds.
  • • iOS background Wait limits: Apple Shortcuts kills built-in Wait actions after ~30 seconds when the iPhone screen is locked.

04 // Engineered Solution

  • ✓ Dedicated AppIntent (CarPlay Disconnected With Delay) dispatches the disconnect signal via App Group UserDefaults and Darwin Notifications (CFNotificationCenter) into the background tracker — bypassing Shortcuts’ 30-second Wait ceiling.
  • ✓ TripTrackerService initiates a configurable grace period (180s default; 30s / 1m / 2m / 3m / 5m in PL/EN/UK SettingsView) while keeping CoreLocation GPS telemetry and Lock Screen Live Activity active.
  • ✓ In-Motion Guard: a 1 Hz background state loop checks carPlayDisconnectDeadline and GPS speed — if speed ≥ 15 km/h, termination defers by +30s continuously until the vehicle stops (with a 5-min stationary failsafe) or CarPlay reconnects.
  • ✓ Instant Reconnect & Multi-Device Sync: re-detecting a CarPlay scene, .carAudio route, or Start Trip immediately cancels the countdown without splitting the trip, while Layer 2 Trip Lock and completed logs sync across devices via Supabase Realtime.

05 // Verified Scope & Outcomes

  • ◆ Eliminated split trips on CarPlay drops: reconnect tolerance increased from 20 seconds to a configurable 30 s – 5 min window (180 s default) with continuous ≥ 15 km/h motion deferral.
  • ◆ Zero driver intervention: trip start, transient disconnect buffering, and final save execute silently in the background with iPhone locked.
  • ◆ Uninterrupted telemetry & multi-device sync: mileage and Live Activity survive wireless CarPlay adapter reboots, syncing finalized trips automatically into Supabase Realtime.
Technologies & API Integrations
Swift & SwiftUISwiftDataApple AppIntentsApple ShortcutsCarPlay FrameworkCoreLocationActivityKit (Live Activities)AVFoundation (.carAudio)Darwin NotificationsSupabase RealtimeTestFlight CLI
Deploy a similar workflow →

Explore Other AI & n8n Case Studies

1 / 1