beekon_flutter 0.1.1 copy "beekon_flutter: ^0.1.1" to clipboard
beekon_flutter: ^0.1.1 copied to clipboard

Flutter plugin for the Beekon location SDK (Android + iOS).

[Beekon]

beekon_flutter

Background location tracking for Flutter.
Keeps working in the background — and after the app is closed.

pub.dev Platforms · Android | iOS

Docs · getbeekon.com · GitHub


Beekon tracks location on Android and iOS — in the foreground, in the background, and after the app is swiped away. Every fix lands in a 7-day on-device history you can query any time. Point it at a backend you control and it uploads for you; leave that unset and nothing ever leaves the device.

Features #

  • 📍 Background tracking — keeps logging in the background and after termination
  • 🔋 Battery-aware — accuracy presets and automatic pause while stationary
  • 💾 On-device history — 7 days of fixes, queryable any time, survives restarts
  • 🗺️ Geofencing — enter/exit events that keep firing across app launches
  • ☁️ Server sync — optional batched, self-retrying upload to your own endpoint
  • 📊 Rich fixes — accuracy, speed, bearing, altitude, motion, and activity
  • 🪵 Diagnostic logging — on-device log buffer, runtime level, NDJSON export

Install #

dependencies:
  beekon_flutter: ^0.1.1

minSdk 26 (Android 8) · iOS 17+. See Setup for the per-platform OS config.

Quick start #

import 'package:beekon_flutter/beekon_flutter.dart';

// Configure is optional — these are the defaults.
await Beekon.instance.configure(
  const BeekonConfig.selfManaged(
    minTimeBetweenLocationsSeconds: 30,
    minDistanceBetweenLocationsMeters: 100,
  ),
);

// Receive live fixes.
Beekon.instance.locations.listen((loc) {
  print('${loc.latitude}, ${loc.longitude}');
});

// Start tracking. (Request location permission first — see Setup.)
await Beekon.instance.start();

start() and stop() never throw. Watch state for whether tracking is live and why it stopped:

Beekon.instance.state.listen((state) {
  if (state is Stopped && state.reason == StopReason.permissionDenied) {
    // Ask for location permission, then call start() again.
  }
});

Send to your backend #

Give Beekon an endpoint and it uploads fixes for you — batched, in the background, with automatic retries. Without a sync config, all data stays on the device.

await Beekon.instance.configure(
  const BeekonConfig.selfManaged(
    sync: SyncConfig(url: 'https://api.example.com/locations'),
  ),
);

Your server receives a small JSON envelope and acknowledges it with a status code. Build your ingest endpoint is a complete, working example. Need authenticated uploads? Pass SyncConfig.auth and the SDK attaches and refreshes the token natively, even in the background — see Auth & token refresh.

More #

// One-shot fix, independent of tracking (null on timeout).
final fix = await Beekon.instance.getCurrentLocation(
  timeout: const Duration(seconds: 15),
);

// Query the on-device history.
final fixes = await Beekon.instance.getLocations(
  from: DateTime.now().subtract(const Duration(days: 1)),
  to: DateTime.now(),
);

// Geofences — enter/exit events survive app launches.
await Beekon.instance.addGeofences([
  const BeekonGeofence(id: 'home', latitude: 37.7749, longitude: -122.4194, radiusMeters: 150),
]);
Beekon.instance.geofenceEvents.listen((e) => print('${e.type.name} → ${e.geofenceId}'));

// Pre-start permission check (the app still owns the request).
final status = await Beekon.instance.getPermissionStatus();

// Diagnostics — runtime level, live tail, NDJSON export for bug reports.
await Beekon.instance.setLogLevel(LogLevel.debug);
final logPath = await Beekon.instance.exportLog();

A license key is optional and purely observational — supply one with BeekonConfig.selfManaged(licenseKey: 'eyJ…') and read licenseStatus(); without one, Beekon runs in evaluation mode. Full API and guides: docs.getbeekon.com.

Setup #

Request location permission in your app before calling start(), then add the platform configuration below.

Android  ·  minSdk 26

Beekon merges its permissions and foreground service into your app automatically. At runtime, request:

  • ACCESS_FINE_LOCATION (or ACCESS_COARSE_LOCATION)
  • POST_NOTIFICATIONS on Android 13+

A notification is shown while tracking — customise it with NotificationConfig.

iOS  ·  iOS 17+

Add to ios/Runner/Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>Used to show your location in the app.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Used to keep tracking your trips in the background.</string>
<key>UIBackgroundModes</key>
<array>
  <string>location</string>
  <string>fetch</string>
</array>
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
  <string>in.wayq.beekon.sync</string>
</array>

iOS uses Swift Package Manager. On Flutter older than 3.44, enable it once:

flutter config --enable-swift-package-manager

How it works #

Live updates flow to locations only while your app is running, but the native engine keeps recording in the background and stores every fix on the device. That's why getLocations() returns the whole window — there may be gaps in the live stream, but not in your history.

Beekon Cloud #

Prefer managed ingest, a console, and server-owned config instead of running your own backend? Beekon Cloud is in private beta — see the docs.

License #

Beekon is licensed for evaluation use. See LICENSE, or contact WayQ Technologies for production licensing.


© WayQ Technologies Pvt Ltd