benjamindean / flutter_vibration

Handle vibration on iOS and Android in Flutter apps
217 stars 67 forks source link

Vibrate without user interaction #60

Closed begandroide closed 1 year ago

begandroide commented 3 years ago

Hi! how to vibrate without user interaction? i'm making flutter app that read qr codes, and i want vibrate as feedback once qr is readed.

The vibrate function is usefull when i tap a button or i have interaction with the UI, but if i call from a stream or subscription the vibration is not triggered.

Regards

benjamindean commented 3 years ago

Hey! Can you provide an example? It should work, but I suspect that when it comes to streams it might not due to some platform channel restrictions.

begandroide commented 3 years ago

ok @benjamindean in couple of hours i will do it. And yes, event comes from a stream... Yesterday searching i found that haptic feedback only can be triggered with user interaction, so i think that is a api device restriction (but is only a supose, i didn't find it in official Android/Flutter page).

benjamindean commented 1 year ago

Have you been able to solve the issue? I will close it for now and will reopen if needed.