flutter_vibration icon indicating copy to clipboard operation
flutter_vibration copied to clipboard

kSystemSoundID_Vibrate when haptics not available

Open zywek123 opened this issue 7 months ago • 3 comments

Haptics not work when screen is locked, as mentioned in #94 which is not merged. So, play kSystemSoundID_Vibrate, when haptic engine not works.

zywek123 avatar May 27 '25 11:05 zywek123

@benjamindean and what's wrong with that? What is the default behavior?

zywek123 avatar Jun 06 '25 08:06 zywek123

@benjamindean and what's wrong with that? What is the default behavior?

Users should be able to vibrate with only duration. And duration can be of any value.

benjamindean avatar Jun 07 '25 10:06 benjamindean

OK, will revert it. But... It is not possible to support background vibrations automatically. Apply my first commit in this PR, write a simple app which vibrates when You would use compass or whatever, on iPhone ofcourse, press or swipe to go to home screen... App should vibrate using KSystemSoundID_VIbration, or whatever... but, the plugin did not receive an exception from CHHaptic. It sometimes happens when CHHaptic works when you're switching to another app, home screen or locking the screen. The best idea is to add legacy parameter, but the flutter programmer should know when the app is not shown, then decide to vibrate using Core Haptics only when the app is visible, othervise with legacy: true parameter.

zywek123 avatar Jun 07 '25 10:06 zywek123