dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

Vibrate behavior inconsistent between Android and iOS #12501

Open BioTurboNick opened 1 year ago

BioTurboNick commented 1 year ago

Description

Currently, Vibrate for Android allows a controllable duration in ms, while Vibrate for iOS produces a fixed, unchangable effect of kind of long duration.

Given that the input to the Vibrate method is unused on iOS, it would be worth producing a warning, and perhaps directing people to HapticFeedback to avoid producing unexpected results and make it easy for people to solve the problem.

Steps to Reproduce

n/a

Link to public reproduction project repository

n/a

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 14

Did you find any workaround?

Use HapticFeedback instead.

Relevant log output

No response

jfversluis commented 1 year ago

This is probably just due to iOS not supporting this. It is specified in the docs (which also feeds IntelliSense): https://github.com/dotnet/maui/blob/main/src/Essentials/docs/en/Xamarin.Essentials/Vibration.xml#L72

According to you, what more can we do to make this more obvious?

ghost commented 1 year ago

Hi @BioTurboNick. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

BioTurboNick commented 1 year ago

This is probably just due to iOS not supporting this. It is specified in the docs (which also feeds IntelliSense): https://github.com/dotnet/maui/blob/main/src/Essentials/docs/en/Xamarin.Essentials/Vibration.xml#L72

According to you, what more can we do to make this more obvious?

I suppose what I'd expect is for the single-argument Vibrate methods to produce something to indicate that they will not work on iOS. Perhaps a code analyzer message or warning would be best. If someone is okay with the difference, they can suppress it. If someone isn't, they can do Vibrate() to get consistent behavior, or do conditional compilation.

It's just such a big difference in behavior between platforms, IMO, to leave as just documentation.

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.