Skip to content

@capacitor/motion: Add frequency option #1424

@Maximvdw

Description

@Maximvdw

Feature Request

Plugin

  • @capacitor/motion

Description

Both Accelerometer, Gyroscope and OrientationSensor support a frequency option. My feature request is to support similar functionality in @capacitor/motion

Platform(s)

Web, Android, iOS

Preferred Solution

I have two options:

Motion.addListener('accel', { frequency: 50 }, (event) => {});

or

Motion.setListenerFrequency('accel', 50);
Motion.addListener('accel', (event) => {});

The latter would make more sense when assuming only one 'main' listener is used for the sensors as the frequency would be applied to all listeners for that event.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions