flutter_vibration icon indicating copy to clipboard operation
flutter_vibration copied to clipboard

Create possibility to check if virbration is enabled by user

Open devjeff opened this issue 5 years ago • 5 comments
trafficstars

It would be really cool to check, whether the vibration is enabled by the user, so that one can respect the user settings and vibrate only if the vibration is enabled.

devjeff avatar Feb 12 '20 12:02 devjeff

What kind of setting do you mean? System setting or app setting? And which platform?

benjamindean avatar Feb 12 '20 16:02 benjamindean

Hi, I mean the system settings or sometimes it's called "sound profile". On Android you can enable/disable sound and vibration separately via system settings or the corresponding buttons in the notification bar menu. The programmatic access is described in this stackoverflow question for instance.

So, in Android terms I would to retrieve the currently activated ringer mode. I think, there is a similar functionality in iOS, as described here from the users perspective.

devjeff avatar Feb 14 '20 11:02 devjeff

But what happens now in case vibration is disabled? Does it still vibrate?

benjamindean avatar Feb 20 '20 08:02 benjamindean

Yes, correct. It still vibrates. I think, the OS (at least Android) doesn't forbid that, as the vibration might indicate an important alarm notification. If you take a look at the [ringtone player plugin](https://pub.dev/packages/flutter_ringtone_player#-readme-tab-, it provides the 'asAlarm' flag for that purpose.

devjeff avatar Feb 20 '20 12:02 devjeff

i have the opposite experience. vibration only works if it's enabled in sound settings. I wish i could bypass it. (pixel 6, android 13)

Dieterbe avatar Feb 24 '23 09:02 Dieterbe