ionic-team / ionic-team/capacitor-haptics
@capacitor/haptics: Supported flag
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
## 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.
Contributor guide
Assessment
This issue has not been assessed yet.