tracelet_ios 1.3.6
tracelet_ios: ^1.3.6 copied to clipboard
iOS implementation of the Tracelet background geolocation plugin.
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 Detection —
TripManager.swifttracks 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.swiftfor arbitrary polygon containment checks alongside circular geofences. Learn more → - Mock Location Detection — Spoof detection using
CLLocationSourceInformation(iOS 15+) and timestamp drift heuristic. Configurable viaMockDetectionLevel. Learn more → - OEM Compatibility — iOS has no OEM-specific power management issues. The Settings Health API returns
isAggressiveOem: falseand an emptyoemSettingsScreenslist. Learn more → - Unlimited Geofences — Proximity-based auto-load/unload in
GeofenceManager.swift. Only the closest geofences withingeofenceProximityRadiusare registered with CLLocationManager (up to 20, the iOS limit), enabling monitoring of thousands of geofences. Geofences are dynamically swapped on each location update withgeofencesChangeevents. - Background Task Protection — All critical native operations (location persist, HTTP sync, headless engine boot, lifecycle transitions) are wrapped in
UIApplication.beginBackgroundTaskto prevent iOS from killing the app mid-operation. - iOS 17+ Background Activity Session —
CLBackgroundActivitySessionextends background runtime for continuous location tracking without user interaction. - iOS 18+ Service Session —
CLServiceSessionmaintains location authorization state during background execution. - HTTP Sync Retry Engine — Configurable retry with exponential backoff in
HttpSyncManager.swiftfor transient 5xx, 429, and timeout failures. Defers sync on connectivity loss viaNWPathMonitor. Learn more → - Configurable Motion Sensitivity —
MotionDetector.swiftreadsshakeThreshold,stillThreshold, andstillSampleCountfrom config at runtime (auto-converts m/s² to g-force). - Delta Encoding — Native
DeltaEncoder.swiftcompresses HTTP sync payloads by encoding only field deltas between consecutive locations, achieving 60–80% bandwidth reduction. Uses Foundation'sISO8601DateFormatterwith fractional seconds fallback. - Wi-Fi-Only Sync —
HttpSyncManager.swiftsupportsdisableAutoSyncOnCellularto skip auto-sync on cellular networks.
Usage #
You should not depend on this package directly. Instead, depend on tracelet which automatically includes this package on iOS builds.
dependencies:
tracelet: ^1.1.0
For iOS-specific setup (Info.plist, capabilities, entitlements), see the iOS Setup Guide.
Related Packages #
| 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 |