@capgo/capacitor-accelerometer
Capacitor plugin contract for working with the device accelerometer.
Overview
Section titled “Overview”Capacitor plugin contract for working with the device accelerometer.
Core Capabilities
Section titled “Core Capabilities”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 .
Public API
Section titled “Public API”| Method | Description |
|---|---|
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 . |
checkPermissions | Return the current permission state for accessing motion data. |
requestPermissions | Request permission to access motion data if supported by the platform. |
addListener | Listen for measurement updates. |
removeAllListeners | Remove all listeners that have been registered on the plugin. |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-accelerometer.