Skip to content

@capgo/capacitor-accelerometer

Capacitor plugin contract for working with the device accelerometer.

Capacitor plugin contract for working with the device accelerometer.

  • getMeasurement - Get the most recent accelerometer sample that was recorded by the native layer.
  • isAvailable - Check if the current device includes an accelerometer sensor.
  • startMeasurementUpdates - Begin streaming accelerometer updates to the JavaScript layer.
  • stopMeasurementUpdates - Stop streaming accelerometer updates started via .
MethodDescription
getMeasurementGet the most recent accelerometer sample that was recorded by the native layer.
isAvailableCheck if the current device includes an accelerometer sensor.
startMeasurementUpdatesBegin streaming accelerometer updates to the JavaScript layer.
stopMeasurementUpdatesStop streaming accelerometer updates started via .
checkPermissionsReturn the current permission state for accessing motion data.
requestPermissionsRequest permission to access motion data if supported by the platform.
addListenerListen for measurement updates.
removeAllListenersRemove all listeners that have been registered on the plugin.
getPluginVersionGet the native Capacitor plugin version.

This reference is synced from src/definitions.ts in capacitor-accelerometer.