traccar_client_sdk 0.0.14 copy "traccar_client_sdk: ^0.0.14" to clipboard
traccar_client_sdk: ^0.0.14 copied to clipboard

Flutter plugin for background location tracking. Wraps the Traccar Client SDK for Android and iOS.

traccar_client_sdk #

Flutter plugin for background location tracking. Sends position updates over a simple HTTP GET protocol - works with Traccar and any compatible server. Wraps the Traccar Client SDK for Android and iOS - see the main repository for architecture, reliability, and configuration details.

Requires Android API 24+ and iOS 15+.

Usage #

import 'package:traccar_client_sdk/traccar_client_sdk.dart';

final tracker = TraccarClientSdk();

await tracker.start(Config(
  serverUrl: 'https://demo.traccar.org',
  deviceId: '123456',
));

await tracker.stop();

API #

  • start(Config) - begin tracking. Returns false if required Android permissions were denied.
  • stop() - stop tracking and clear saved config.
  • requestPosition(Config) - one-off fix and upload, independent of start/stop.
  • isTracking() - query current state.
  • getLogs() - recent diagnostic entries (time ms, message).
  • clearLogs() - clear the diagnostic store.

Configuration #

Config accepts a LocationConfig (accuracy, distanceMeters, intervalSeconds, angleDegrees, stopDetection, stopTimeoutSeconds, stationaryRadiusMeters), a Boolean buffer (real-time-only when false), Android-only wakeLock, and a NotificationConfig for the Android foreground-service text. See the main repo for details and defaults.

Permissions #

The plugin requests location, notification (Android 13+), and activity recognition (Android 10+) permissions at runtime via a transparent activity. On first start it also opens the Ignore Battery Optimization settings screen once.

On iOS, add these keys to your app's Info.plist:

  • NSLocationAlwaysAndWhenInUseUsageDescription
  • NSLocationWhenInUseUsageDescription
  • NSMotionUsageDescription

and enable the Location updates background mode in your target capabilities.

License #

Apache License 2.0 - see LICENSE.

0
likes
150
points
331
downloads

Documentation

API reference

Publisher

verified publishertraccar.org

Weekly Downloads

Flutter plugin for background location tracking. Wraps the Traccar Client SDK for Android and iOS.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on traccar_client_sdk

Packages that implement traccar_client_sdk