tracelet_ios 0.12.0
tracelet_ios: ^0.12.0 copied to clipboard
iOS implementation of the Tracelet background geolocation plugin.
0.12.0 #
Performance Audit — 22 iOS issues resolved #
- PERF: Cache
ISO8601DateFormatteras static instance (I-C1, I-C2). - PERF: Call
UIDevice.isBatteryMonitoringEnabledonce at plugin initialization (I-C3). - PERF: Add serial
stateQueuefor thread-safe sync flag access (I-C4). - PERF: Use
BackgroundTaskHelper.shared.begin()with proper expiration handler (I-C5). - PERF: Reduce accelerometer to 10 Hz and deliver on background queue (I-H1).
- PERF: Set timer tolerance to 10% for iOS energy coalescing (I-H2).
- PERF: Use SQLite transactions for batch geofence inserts (I-H3).
- PERF: Throttle DB pruning to every 100 inserts (I-H4, I-H6).
- PERF: Move JSON serialization outside DB queue lock (I-H5).
- PERF: Default
pausesLocationUpdatesAutomaticallytotrue(I-M1). - PERF: Make
activityTypeconfigurable viagetActivityType()mapping (I-M2). - PERF: Reuse
URLSession—getAllTaskscancel instead ofinvalidateAndCancel(I-M3). - PERF: Defer
BGAppRefreshTask.setTaskCompleteduntil async location fix returns (I-M4). - PERF: Find monitored region by identifier instead of creating dummy
CLCircularRegion(I-M5). - PERF: Add in-memory privacy zone cache with CRUD invalidation (I-M7).
- PERF: Add in-memory geofence cache with CRUD invalidation (I-M8).
- PERF: Lazy-init
CMMotionActivityManagerandCMPedometerfor accelerometer-only mode (I-L1). - PERF: Remove duplicate
haversine()fromGeofenceManager, call module-level function (I-L3). - PERF: Remove dead
@available(iOS 14)self-assign no-op (I-L4). - REFACTOR: Remove trivial
isMoreRestrictive()wrapper, inlineisActionMoreRestrictive()call (I-L5). - CHORE: Add CoreLocation import to
ConfigManager.swiftforCLActivityType.
0.11.5 #
- FIX: Persist polygon geofence
verticesto SQLite — addvertices TEXTcolumn withPRAGMA table_infomigration for existing installs, and JSON serialization/deserialization ininsertGeofence()/geofenceRowToMap(). - FIX: Use
NSNumberbridging forJSONSerializationvertex deserialization (fixes silent cast failure with[[Double]]). - FIX: Handle heterogeneous vertex arrays — skip non-array entries instead of failing the entire cast.
- TEST: Add XCTest tests for geofence vertices CRUD (11 tests covering round-trip, validation, edge cases).
- TEST: Add DB migration integration tests — column addition, data preservation, idempotency, multi-geofence migration, fresh install.
0.11.4 #
- FIX: Revert over-aggressive
allowsBackgroundLocationUpdatesand significant-location guards — When In Use permission now works correctly for foreground and background tracking. iOS enforces permission at the OS level; only the killed-state entry point (autoResumeTracking) requires Always authorization.
0.11.3 #
- FIX: Add
.authorizedAlwaysguard toautoResumeTracking()— prevents "When In Use" permission from triggering tracking after app is relaunched from killed state via significant-location-change. - FIX: Guard
allowsBackgroundLocationUpdatesinconfigureLocationManager()andperformPeriodicFix()— only set totruewhen Always authorization is granted.
0.11.2 #
- CHORE: Tighten
tracelet_platform_interfaceconstraint to^0.11.2.
0.11.1 #
- FIX: Set
event: "periodic"in alldidUpdateLocationscode paths for periodic tracking (was empty string). - FEAT: Add
canScheduleExactAlarms(returnstrue) andopenExactAlarmSettings(returnsfalse) method channel stubs. - CHORE: Add NSLog diagnostic logging to
startPeriodic()andperformPeriodicFix(). - CHORE: Bump platform interface to 0.11.1.
0.11.0 #
- FEAT:
AuditTrailManager— SHA-256 hash chain with SQLite persistence and UserDefaults chain state. - FEAT:
PrivacyZoneManager— Haversine distance-based zone evaluation with exclude, degrade, and event-only actions. - FEAT: Privacy zones database table with CRUD operations.
- FEAT: Audit trail database table with hash chain linkage.
- FEAT:
ConfigManagergetters for audit and privacy zone configuration. - CHORE: Bump
tracelet_platform_interfaceto ^0.11.0.
0.10.0 #
- FEAT: Periodic mode — GPS-friendly interval tracking via
startPeriodic(). Timer-based scheduling with background location toggling per fix. - FEAT:
ConfigManagerperiodic config getters for interval, accuracy, foreground service, and exact alarms. - FIX:
ConfigManager.swiftescaped string literals causing Swift compilation failure. - CHORE: Bump
tracelet_platform_interfaceto ^0.10.0.
0.9.1 #
- FIX: Safe optional unwrap of
UIBackgroundTaskIdentifierinHttpSyncManager.syncNextBatch()— fixes Swift compiler error.
0.9.0 #
- FEAT: HTTP sync retry engine — configurable retry with exponential backoff for transient 5xx, 429, and timeout failures. Defers sync on connectivity loss via
NWPathMonitor. Batch continuation loop. - FEAT: Configurable motion sensitivity —
MotionDetectorreadsshakeThreshold,stillThreshold,stillSampleCountfromConfigManagerat runtime (auto-converts m/s² to g-force). - CHORE: Bump
tracelet_platform_interfaceto ^0.9.0.
0.8.3 #
- FEAT: Proximity-based geofence auto-load/unload — only geofences within
geofenceProximityRadiusare registered with CLLocationManager, sorted by distance, capped at 20 (iOS limit). Enables monitoring thousands of geofences. - FEAT:
GeofenceManager.updateProximity()— re-evaluates which geofences to monitor on every location update, dynamically swapping region registrations as the device moves. - FEAT:
geofencesChangeevent fires withon/offarrays when geofences are activated/deactivated from proximity monitoring. - FEAT:
maxMonitoredGeofencesconfig respected — caps simultaneously monitored regions below the platform limit. - CHORE: Bump
tracelet_platform_interfaceto ^0.8.3.
0.8.2 #
- DOCS: Improve README visuals with combined Android & iOS demo image.
0.8.1 #
- FEAT:
BackgroundTaskHelper— central thread-safe utility wrappingUIApplication.beginBackgroundTaskfor safe background execution of native operations. - FEAT: iOS 17+
CLBackgroundActivitySessionsupport viaBackgroundActivitySessionManager— extends background runtime for location-tracking apps. - FEAT: iOS 18+
CLServiceSessionsupport viaServiceSessionManager— maintains authorization state during background execution. - PERF: Wrap
LocationEngine.didUpdateLocationsin background task — protects persist + dispatch chain from iOS suspension. - PERF: Wrap
HttpSyncManager.sync()in background task — protects entire HTTP upload + DB cleanup cycle. - PERF: Wrap
HeadlessRunner.dispatchEvent()engine boot in background task — ensures Dart engine starts fully before iOS reclaims resources. - PERF: Wrap all
TraceletIosPluginlifecycle transitions (handleStop,handleReset,onStopRequested,handleScheduleStop,stopAfterElapsedTimer) in background tasks. - FIX:
preventSuspendManager.start()now called instartGeofences()— was missing, causing audio keep-alive to not activate in geofence-only mode. - FIX:
preventSuspendManager.stop()now called in all stop paths (reset, stopOnStationary, scheduleStop, stopAfterElapsed) — was only called inhandleStop(). - FIX:
setConfig()now togglespreventSuspendManagermid-session whenpreventSuspendchanges. - FIX:
reset()now callscancelStopAfterElapsedTimer()— was leaving stale timer running after reset. - FIX: iOS 17+/18+ session managers wired into all lifecycle paths (start, stop, startGeofences, reset, scheduleStart/Stop, stopOnStationary, stopAfterElapsed).
0.8.0 #
- FEAT: OEM compatibility stubs —
getSettingsHealthreturnsisAggressiveOem: false(iOS has no OEM power management issues),openOemSettingsreturnsfalse. - DOCS: Update README with OEM compatibility note and documentation link.
- CHORE: Bump
tracelet_platform_interfaceto ^0.8.0.
0.7.1 #
- DOCS: Add mock location detection feature to README with platform-specific detection details.
- CHORE: Bump
tracelet_platform_interfaceto ^0.7.1.
0.7.0 #
- FEAT: Mock location detection —
isLocationMock()usesCLLocationSourceInformation(iOS 15+) to detect simulated locations. - FEAT: Heuristic mock detection (level 2) — timestamp drift check (> 10s between location timestamp and system time = suspicious).
- FEAT:
buildLocationMap()includesmockflag andmockHeuristicsmetadata map (timestampDriftMs, platformFlagMock). - FEAT: Native-level mock rejection — when
rejectMockLocationsis enabled, drops mocked locations before sending to Dart and firesProviderChangeEvent.mockLocationsDetected. - FEAT:
ConfigManager.getMockDetectionLevel()andgetRejectMockLocations()getters. - CHORE: Bump
tracelet_platform_interfaceto ^0.7.0.
0.6.1 #
- REFACTOR: Remove 6 dead
ConfigManagermethods for filtering migrated to Dart in 0.6.0 (getDisableElasticity,getElasticityMultiplier,getFilterPolicy,getMaxImpliedSpeed,getTrackingAccuracyThreshold,getUseKalmanFilter). - REFACTOR: Remove dead
EventDispatcher.sendTrip()and"trip"channel registration — trip events now from DartTripManager. - CHORE: Bump
tracelet_platform_interfaceto ^0.6.1.
0.6.0 #
- REFACTOR: Remove duplicate location filtering from
LocationEngine.didUpdateLocations()— elasticity, distance filter, accuracy filter, and speed filter now handled by shared DartLocationProcessor. - REFACTOR: Replace
GeofenceManager.evaluateHighAccuracyProximity()with no-op stub — proximity evaluation moved to shared DartGeofenceEvaluator. - CHORE: Bump
tracelet_platform_interfaceto ^0.6.0.
0.5.5 #
- FIX:
onScheduleevent now sends full state map (viastateManager.toMap()) instead of partial["state": "on", "enabled": true]— fixesState.fromMap()crash on schedule events.
0.5.4 #
- FIX: Heartbeat event now wraps location data in
{"location": ...}to matchHeartbeatEvent.fromMap()— fixes heartbeat always returning zero coordinates. - FIX: Heartbeat falls back to last known location (via
buildLocationMap()) whengetCurrentPositionreturns null.
0.5.3 #
- CHORE: Bump
tracelet_platform_interfaceto ^0.5.3.
0.5.2 #
- FEAT: Accelerometer-only motion detection mode — when
disableMotionActivityUpdatesistrue, usesCMMotionManagerraw accelerometer for permission-free stationary↔moving detection (noNSMotionUsageDescriptionrequired). - FEAT:
getMotionAuthorizationStatus()/requestMotionPermission()return3(granted) immediately in accelerometer-only mode — no OS dialog shown. - PERF: Reuse shared
CMMotionManagerinstance for sensor queries instead of creating throwaway instances. - FIX: Auto-fallback to accelerometer-only when
CMMotionActivityManager.isActivityAvailable()returnsfalse.
0.5.1 #
- DOCS: Rewrite README with proper description, setup guide link, and related packages table.
0.5.0 #
- CHORE: Bump
tracelet_platform_interfaceto ^0.5.0. - CHORE: Bump version to 0.5.0.
0.4.0 #
- FEAT:
getMotionPermissionStatus()/requestMotionPermission()— CMMotionActivityManager authorization check. - FIX: Speed always zero in motionchange events — track
lastEffectiveSpeedin LocationEngine. - FIX: "Upgrade to Always" dialog not appearing — fix
handleStartisMoving initialization. - FIX: MotionDetector motion state bugs — proper accelerometer + activity recognition lifecycle.
- CHORE: Bump
tracelet_platform_interfaceto ^0.4.0.
0.3.0 #
- FEAT: One-shot location via
getCurrentPosition()withpersist,samples,maximumAge, andextrasparameters. - FEAT: Multi-sample collection with
distanceFilter = kCLDistanceFilterNoneandDispatchQueuetimeout guard. - FEAT:
getLastKnownLocation()— prefers own cached location, falls back toCLLocationManager.location. - FEAT:
ForegroundServiceConfig.enabledsupport. - FIX: Add
CLAuthorizationStatusguard ingetCurrentPosition()— returns nil if not authorized instead of hanging. - FIX: Single-sample path now sets
desiredAccuracy = kCLLocationAccuracyBestbeforerequestLocation(). - BREAKING: Requires
tracelet_platform_interface: ^0.3.0.
0.2.4 #
- Fix LICENSE file format for proper SPDX detection on pub.dev.
0.2.3 #
- Fix
ConfigManager.setConfig()— flatten nested section sub-maps (geo,app,http, etc.) sent by Dart before processing. Fixes all user config values being silently ignored in favor of defaults.
0.2.2 #
- Fix duplicate keys in
ConfigManager.defaultConfig()dictionary literal causing runtime crash.
0.2.1 #
- Version bump for coordinated release.
0.2.0 #
- Add Swift Package Manager support.
- Fix podspec homepage URL.
- Fix podspec source_files and resource_bundles paths for SPM layout.
- Add SPDX
license: Apache-2.0identifier for pub.dev scoring.
0.1.0 #
- Initial release.
- CLLocationManager-based location tracking.
- CoreMotion activity recognition.
- SQLite3 persistence.
- HTTP auto-sync with URLSession.
- CLCircularRegion geofencing.
- Headless FlutterEngine execution.
- BGTaskScheduler integration.
- Significant-change monitoring support.