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.