Implementing SOS Button for Child Tracker in Mobile Application
SOS button in a child tracker isn't just a push notification. It's functionality where failure or delay means real danger. Architectural decisions here are fundamentally different from regular apps.
Requirements That Change the Entire Architecture
Standard FCM push can delay minutes in Doze Mode. For SOS — unacceptable. Need guaranteed delivery with minimal delay and channel redundancy.
Typical redundancy scheme:
-
FCM high-priority push — primary channel, iOS
criticalnotification - SMS via Twilio or SMS gateway — backup if push not delivered in 30 seconds
- VoIP call via CallKit (iOS) or InCallService (Android) — final backup
On iOS PushKit + CallKit is a special channel for VoIP, works even with locked screen and <20% battery. App registers VoIP push credentials separately from regular APNs.
let voipRegistry = PKPushRegistry(queue: DispatchQueue.main)
voipRegistry.delegate = self
voipRegistry.desiredPushTypes = [.voIP]
VoIP push payload arrives in pushRegistry(_:didReceiveIncomingPushWith:for:) — must immediately call CXProvider.reportNewIncomingCall(), otherwise iOS terminates the app within seconds.
Child Device: How SOS Works
Child tracker is either a separate device (GPS watch with SIM) or child's smartphone with app in "child mode".
For GPS watches: device sends SOS signal via GPRS to server (GPRMC protocol or proprietary TCP protocol of specific manufacturer — GT06, Concox, etc.). Server parses packet, extracts coordinates and SOS status, creates alert.
For smartphone with app: native button in interface (large, noticeable, with "Hold 3 seconds" confirmation). Long press handled via GestureDetector with onLongPressStart/onLongPressEnd — delay prevents accidental taps. After confirmation: geolocation request via geolocator → send to server → server broadcasts alert to all parents.
Geolocation During SOS
Accuracy — maximum. GPS only, not network location. On Flutter:
final position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.bestForNavigation,
timeLimit: Duration(seconds: 10),
);
LocationAccuracy.bestForNavigation — GPS + Barometer on iOS, GPS + sensor fusion on Android. GPS failure (basement, building) — fallback to network location, but explicitly mark accuracy in payload.
Coordinates included in SOS notification and displayed on map (MapLibre or Yandex MapKit) in parent's app with "Build Route" button.
Parent App: Handling SOS Alert
SOS notification opens screen with:
- Map with child's marker
- "Call Child" and "I'm Coming" buttons
- Last 10 geo-points history (movement track for last hour)
- Status — "SOS Active" with timer
Tapping "I'm Coming" marks SOS as "acknowledged", and child gets notification "Mom is coming" — two-way communication via server.
Testing and Reliability Requirements
Before release: test SOS delivery in Doze Mode, Airplane Mode (Wi-Fi only), weak signal (3G). Load test: 100 SOS signals simultaneously — server must process and deliver all within 10 seconds.
Apple during review checks correct PushKit usage — can't use VoIP push for non-VoIP purposes, otherwise rejection.
Development timeline: 6–10 weeks (child app + parent app + server with channel redundancy). Integration with existing GPS tracker — from 3 weeks.







