Skip to content

Sensors

export interface Sensors {

Availability of motion sensors on the device, as returned by BackgroundGeolocation.getSensors.

These sensors power the SDK's motion activity-recognition system. When a sensor is absent — particularly on low-end Android devices — motion recognition performance degrades and the SDK may rely more heavily on location-based heuristics.

const sensors = await BackgroundGeolocation.getSensors();
console.log("[Sensors]", sensors);

Members

accelerometer

accelerometer: boolean;

true when the device has an accelerometer.

gyroscope

gyroscope: boolean;

true when the device has a gyroscope.

magnetometer

magnetometer: boolean;

true when the device has a magnetometer (compass).

motion_hardware

motion_hardware?: boolean;

iOS only true when the device has a dedicated M-series motion co-processor (iPhone 5S and later). The M-series co-processor offloads motion activity recognition from the main CPU, enabling low-power step counting and activity detection.

platform

platform: string;

OS platform name: "ios" or "android".

significant_motion

significant_motion?: boolean;

Android only true when the device supports the Significant Motion hardware trigger.

When present, this sensor allows the SDK to wake from a deep idle state only when the device actually moves, saving significant battery.