Safe Zones for Child Tracker in Mobile App
Safe Zones — geofencing: app must alert parent when child leaves school or arrives home. Sounds simple. In practice — 5-10 minute notification delay, trigger when bus parks at school fence, false alarms from GPS drift in 50-100 meters in urban sprawl.
How geofencing works on iOS and Android
iOS — CLLocationManager.startMonitoring(for: CLCircularRegion). System monitors up to 20 regions simultaneously per app. Accuracy of entry/exit detection — about 100-200 meters, delay — up to 3-5 minutes. Regions persisted by system and continue monitored after restart, important for child tracker.
Android — Geofencing API via GeofencingClient from Google Play Services. Limit — 100 geofences per app. Notifications come via PendingIntent in BroadcastReceiver or IntentService. On Android 12+ FINE_LOCATION mandatory for geofencing, BACKGROUND_LOCATION — for background work. Adding geofence: GeofencingRequest.Builder with setInitialTrigger(GEOFENCE_TRANSITION_ENTER) and proper loiteringDelay to cut momentary passes.
GPS drift in city — main cause of false alerts
In dense urban sprawl GPS accuracy drops to 50-150 meters due to multipath reflection. If Safe Zone radius — 100 meters (typical yard), drift easily takes point outside boundary. Solution: don't use one point, take median of last 3-5 measurements before deciding on transition. On server — track smoothing algorithm (Kalman filter or simple weighted moving average by horizontalAccuracy).
Second layer of protection: loiteringDelay in Android Geofencing API — 60-120 seconds. Means DWELL event arrives only if device in zone specified time, not just flew by.
Notifications
Geofence-triggered push must reach parent ASAP. APNs/FCM with high-priority — usually 1-3 second delay. But geofence event from system can have delay: iOS guarantees triggering "on next significant movement or location update," Android in Doze mode — only on Doze exit.
For critical alerts (child left zone at night) worth considering SMS duplication as fallback — especially for kids with budget Android devices without stable internet.
Editing zones in parent app
UI for Safe Zones: user must be able to draw zone on map or set address + radius. Google Maps SDK and MapKit both support overlays for circle drawing. Minimum reasonable radius — 50 meters (else too many false triggers), maximum — 5 km.
Zones sync with server and pushed to child device via FCM/APNs data-push, then child app re-registers geofences. On phone change or app reinstall — auto-load zones from backend.
Safe Zones implementation timeline: 1-3 weeks. Cost depends on platform count and tracker integration.







