Skip to content

Constants

Every constant below is a Dart top-level const exported from the package root (lib/src/constants.dart), not an enum member — import them directly alongside the BackgroundGeolocation facade:

import 'package:bgeo_background_geolocation/bgeo_background_geolocation.dart' as bg;
final accuracy = bg.desiredAccuracyHigh; // -1

Values are chosen to be Transistor-compatible by design — if you’re porting from react-native-background-geolocation or its native Transistorsoft equivalents, these constants (and the config keys and event payloads that use them) carry the same numbers and strings.

Desired accuracy

desiredAccuracy* values for Config.desiredAccuracy and the desiredAccuracy field on CurrentPositionOptions / WatchPositionOptions. Lower (more negative) values request better accuracy; larger values are coarser and cheaper.

ConstantValueMeaning
desiredAccuracyNavigation-2Best accuracy, tuned for turn-by-turn navigation.
desiredAccuracyHigh-1Best accuracy, no navigation-specific tuning.
desiredAccuracyMedium10~10 metre accuracy tier.
desiredAccuracyLow100~100 metre accuracy tier.
desiredAccuracyVeryLow1000~1 kilometre accuracy tier.
desiredAccuracyLowest3000~3 kilometre accuracy tier.

Each value maps to a native accuracy/priority tier:

ConstantiOS (CLLocationManager.desiredAccuracy)Android (fused location Priority)
desiredAccuracyNavigationkCLLocationAccuracyBestForNavigationPRIORITY_HIGH_ACCURACY
desiredAccuracyHighkCLLocationAccuracyBestPRIORITY_HIGH_ACCURACY
desiredAccuracyMediumkCLLocationAccuracyNearestTenMetersPRIORITY_HIGH_ACCURACY
desiredAccuracyLowkCLLocationAccuracyHundredMetersPRIORITY_BALANCED_POWER_ACCURACY
desiredAccuracyVeryLowkCLLocationAccuracyKilometerPRIORITY_LOW_POWER
desiredAccuracyLowestkCLLocationAccuracyThreeKilometersPRIORITY_LOW_POWER

On Android the mapping is bucketed by threshold (≤10 → PRIORITY_HIGH_ACCURACY, ≤100 → PRIORITY_BALANCED_POWER_ACCURACY, otherwise PRIORITY_LOW_POWER), so desiredAccuracyMedium and better all resolve to the same Android priority even though iOS distinguishes them further. Leaving desiredAccuracy unset defaults to kCLLocationAccuracyBest / PRIORITY_HIGH_ACCURACY on their respective platforms.

Log level

logLevel* values for Config.logLevel — see the logging & debugging guide for what gets persisted at each level.

ConstantValueMeaning
logLevelOff0Nothing persisted (default).
logLevelError1Errors only.
logLevelWarning2Warnings and above.
logLevelInfo3Informational and above.
logLevelDebug4Debug and above.
logLevelVerbose5Everything.

Authorization status

authorizationStatus* values resolved by requestPermission() and getProviderState(), and carried as status on the ProviderChangeEvent delivered to onProviderChange.

ConstantValueMeaning
authorizationStatusNotDetermined0Not yet requested.
authorizationStatusRestricted1Restricted (e.g. parental controls).
authorizationStatusDenied2Denied by the user.
authorizationStatusAlways3Always — background tracking is authorized.
authorizationStatusWhenInUse4Foreground-only authorization.

3 (authorizationStatusAlways) is the value apps should compare onProviderChange’s status against to confirm background tracking is actually authorized, rather than merely foreground-authorized.

Accuracy authorization

accuracyAuthorization* values resolved by requestTemporaryFullAccuracy() and carried as the optional accuracyAuthorization field on ProviderChangeEvent (iOS only).

ConstantValueMeaning
accuracyAuthorizationFull0Full accuracy.
accuracyAuthorizationReduced1Reduced accuracy (iOS 14+ “Approximate Location”).

License codes

license* string constants rejected by ready()/start() (and getCurrentPosition()/watchPosition()) in a release build with an invalid license, surfaced as the code of a PlatformException — see License keys. Debuggable builds and the iOS simulator run unlicensed and never reject with these codes.

ConstantValueMeaning
licenseMissing'LICENSE_MISSING'No key present in a release build.
licenseInvalid'LICENSE_INVALID'Bad signature or malformed token.
licenseExpired'LICENSE_EXPIRED'Key expired before this SDK build.
licenseAppMismatch'LICENSE_APP_MISMATCH'Key not bound to this app id / certificate / Team ID.

Activity types

activityType* string values — the vocabulary for Config.triggerActivities and MotionActivity.type.

ConstantValue
activityTypeStill'still'
activityTypeOnFoot'on_foot'
activityTypeWalking'walking'
activityTypeRunning'running'
activityTypeOnBicycle'on_bicycle'
activityTypeInVehicle'in_vehicle'
activityTypeUnknown'unknown'