Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create possibility to check if virbration is enabled by user #25

Closed
devjeff opened this issue Feb 12, 2020 · 6 comments
Closed

Create possibility to check if virbration is enabled by user #25

devjeff opened this issue Feb 12, 2020 · 6 comments

Comments

@devjeff
Copy link

devjeff commented Feb 12, 2020

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.

@benjamindean
Copy link
Owner

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

@devjeff
Copy link
Author

devjeff commented Feb 14, 2020

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.

@benjamindean
Copy link
Owner

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

@devjeff
Copy link
Author

devjeff commented Feb 20, 2020

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.

@Dieterbe
Copy link

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)

@benjamindean
Copy link
Owner

Unfortunately, the system settings are in place exactly for preventing any apps from vibrating/making sounds. So, this feature is definitely not an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants