Skip to content

@capacitor/haptics: Supported flag #6

@aeharding

Description

@aeharding

Feature Request

Plugin

@capacitor/haptics

Description

Apps may want to have an "Enable Haptic Feedback" toggle. However, such a toggle doesn't make sense on devices that don't support haptics (such as Apple A2HS or in the Safari app).

It would be nice if the Haptics plugin had a function to return a boolean if haptics are supported on the current device.

Platform(s)

All

Preferred Solution

Haptics.supported() or such

Alternatives

Can do some rudimentary detection, such as:

!isNative() && !("vibrate" in window.navigator)

but that doesn't cover unsupported on native and may break if a new haptic web API is released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions