tracelet_ios

iOS implementation of the Tracelet background geolocation plugin.

This package uses Swift and native Apple frameworks (CoreLocation, CoreMotion, BackgroundTasks, SQLite3) to provide production-grade background location tracking.

Native Features

  • Kalman Filter GPS Smoothing — Extended Kalman Filter implementation (KalmanLocationFilter.swift) smooths raw GPS coordinates using device-reported accuracy as measurement noise. Produces cleaner tracks and eliminates jitter. Learn more →
  • Trip DetectionTripManager.swift tracks motion state transitions to detect trip start/stop. Each trip includes distance, duration, waypoints, and start/stop locations. Learn more →
  • Polygon Geofences — Ray-casting point-in-polygon algorithm in GeofenceManager.swift for arbitrary polygon containment checks alongside circular geofences. Learn more →
  • Mock Location Detection — Spoof detection using CLLocationSourceInformation (iOS 15+) and timestamp drift heuristic. Configurable via MockDetectionLevel. Learn more →
  • OEM Compatibility — iOS has no OEM-specific power management issues. The Settings Health API returns isAggressiveOem: false and an empty oemSettingsScreens list. Learn more →
  • Background Task Protection — All critical native operations (location persist, HTTP sync, headless engine boot, lifecycle transitions) are wrapped in UIApplication.beginBackgroundTask to prevent iOS from killing the app mid-operation.
  • iOS 17+ Background Activity SessionCLBackgroundActivitySession extends background runtime for continuous location tracking without user interaction.
  • iOS 18+ Service SessionCLServiceSession maintains location authorization state during background execution.

Usage

You should not depend on this package directly. Instead, depend on tracelet which automatically includes this package on iOS builds.

dependencies:
  tracelet: ^0.5.0

For iOS-specific setup (Info.plist, capabilities, entitlements), see the iOS Setup Guide.

Package Description
tracelet App-facing Dart API — the only package you depend on
tracelet_platform_interface Abstract platform interface
tracelet_android Android implementation
tracelet_web Web implementation

More Information

Libraries

tracelet_ios
iOS implementation of the Tracelet background geolocation plugin.