Constants
Every constant below is attached to the default export
(BackgroundGeolocation.DESIRED_ACCURACY_HIGH) and importable
individually:
import BackgroundGeolocation, { DESIRED_ACCURACY_HIGH } from '@dc-bgeo/react-native-background-geolocation';Values are chosen to be Transistor-compatible by design — if you’re porting
from react-native-background-geolocation, these constants (and the config
keys and event payloads that use them) carry the same numbers and strings.
Desired accuracy
DESIRED_ACCURACY_* values for config.desiredAccuracy
and the desiredAccuracy option on
getCurrentPosition() /
watchPosition(). Lower
(more negative) values request better accuracy; larger values are coarser and
cheaper.
| Constant | Value | Meaning |
|---|---|---|
DESIRED_ACCURACY_NAVIGATION | -2 | Best accuracy, tuned for turn-by-turn navigation. |
DESIRED_ACCURACY_HIGH | -1 | Best accuracy, no navigation-specific tuning. |
DESIRED_ACCURACY_MEDIUM | 10 | ~10 metre accuracy tier. |
DESIRED_ACCURACY_LOW | 100 | ~100 metre accuracy tier. |
DESIRED_ACCURACY_VERY_LOW | 1000 | ~1 kilometre accuracy tier. |
DESIRED_ACCURACY_LOWEST | 3000 | ~3 kilometre accuracy tier. |
Each value maps to a native accuracy/priority tier:
| Constant | iOS (CLLocationManager.desiredAccuracy) | Android (fused location Priority) |
|---|---|---|
DESIRED_ACCURACY_NAVIGATION | kCLLocationAccuracyBestForNavigation | PRIORITY_HIGH_ACCURACY |
DESIRED_ACCURACY_HIGH | kCLLocationAccuracyBest | PRIORITY_HIGH_ACCURACY |
DESIRED_ACCURACY_MEDIUM | kCLLocationAccuracyNearestTenMeters | PRIORITY_HIGH_ACCURACY |
DESIRED_ACCURACY_LOW | kCLLocationAccuracyHundredMeters | PRIORITY_BALANCED_POWER_ACCURACY |
DESIRED_ACCURACY_VERY_LOW | kCLLocationAccuracyKilometer | PRIORITY_LOW_POWER |
DESIRED_ACCURACY_LOWEST | kCLLocationAccuracyThreeKilometers | PRIORITY_LOW_POWER |
On Android the mapping is bucketed by threshold (≤10 → PRIORITY_HIGH_ACCURACY,
≤100 → PRIORITY_BALANCED_POWER_ACCURACY, otherwise PRIORITY_LOW_POWER), so
DESIRED_ACCURACY_MEDIUM 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
LOG_LEVEL_* values for config.logLevel —
see the logging & debugging guide for what
gets persisted at each level.
| Constant | Value | Meaning |
|---|---|---|
LOG_LEVEL_OFF | 0 | Nothing persisted (default). |
LOG_LEVEL_ERROR | 1 | Errors only. |
LOG_LEVEL_WARNING | 2 | Warnings and above. |
LOG_LEVEL_INFO | 3 | Informational and above. |
LOG_LEVEL_DEBUG | 4 | Debug and above. |
LOG_LEVEL_VERBOSE | 5 | Everything. |
Authorization status
AUTHORIZATION_STATUS_* values resolved by
requestPermission()
and getProviderState(),
and carried as status on the
ProviderChangeEvent
delivered to onProviderChange.
| Constant | Value | Meaning |
|---|---|---|
AUTHORIZATION_STATUS_NOT_DETERMINED | 0 | Not yet requested. |
AUTHORIZATION_STATUS_RESTRICTED | 1 | Restricted (e.g. parental controls). |
AUTHORIZATION_STATUS_DENIED | 2 | Denied by the user. |
AUTHORIZATION_STATUS_ALWAYS | 3 | Always — background tracking is authorized. |
AUTHORIZATION_STATUS_WHEN_IN_USE | 4 | Foreground-only authorization. |
3 (AUTHORIZATION_STATUS_ALWAYS) is the value apps should compare
onProviderChange’s status against to confirm background tracking is
actually authorized, rather than merely foreground-authorized.
Accuracy authorization
ACCURACY_AUTHORIZATION_* values resolved by
requestTemporaryFullAccuracy()
and carried as the optional accuracyAuthorization field on
ProviderChangeEvent (iOS only).
| Constant | Value | Meaning |
|---|---|---|
ACCURACY_AUTHORIZATION_FULL | 0 | Full accuracy. |
ACCURACY_AUTHORIZATION_REDUCED | 1 | Reduced accuracy (iOS 14+ “Approximate Location”). |
License codes
LICENSE_* string codes rejected by ready()/start() (and
getCurrentPosition()/watchPosition()) in a release build with an
invalid license — see License keys.
Debug builds run unlicensed and never reject with these codes.
| Constant | Value | Meaning |
|---|---|---|
LICENSE_MISSING | 'LICENSE_MISSING' | No key present in a release build. |
LICENSE_INVALID | 'LICENSE_INVALID' | Bad signature or malformed token. |
LICENSE_EXPIRED | 'LICENSE_EXPIRED' | Key expired before this SDK build. |
LICENSE_APP_MISMATCH | 'LICENSE_APP_MISMATCH' | Key not bound to this app id / certificate / Team ID. |
Activity types
ACTIVITY_TYPE_* string values — the vocabulary for
config.triggerActivities
and MotionActivity.type.
| Constant | Value |
|---|---|
ACTIVITY_TYPE_STILL | 'still' |
ACTIVITY_TYPE_ON_FOOT | 'on_foot' |
ACTIVITY_TYPE_WALKING | 'walking' |
ACTIVITY_TYPE_RUNNING | 'running' |
ACTIVITY_TYPE_ON_BICYCLE | 'on_bicycle' |
ACTIVITY_TYPE_IN_VEHICLE | 'in_vehicle' |
ACTIVITY_TYPE_UNKNOWN | 'unknown' |