Open AncientLust opened 1 week ago
Hi @AncientLust. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
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.
Description
The issue is with
HapticFeedback.Default.Perform
. On iOS it works or not depending on what code follows this line. Sometimes with some chance. For example:The situation getting worse when you try to use haptic feedback in a more complex situation, like this:
In this case it just can have zero vibrations, vibrate only once or vibrate twice as you expect.
Let us keep this bug report for a while just to see if people have the same issues with haptic feedback. Because googling of "MAUI inconsistent haptic feedback" returns nothing.
What I tried:
HapticFeedback.Default.Perform
from main thread viaMainThread.BeginInvokeOnMainThread
/InvokeOnMainThreadAsync
.HapticFeedback.Default.Perform
via "run and forget" usingTask.Run()
.Don't see this issue on Android. On iOS both
Click
andLongPress
have this problematic behavior.Steps to Reproduce
Wasn't able to reproduce in the clean MAUI project, since behaviour depends on the code which follows haptic feedback usage. Without it it works fine. I will update the bug report if I will find a way to reproduce it.
Link to public reproduction project repository
No response
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17.6.1
Did you find any workaround?
So far the only workaround I found is to place
await Task.Delay()
afterwards with at least 100 ms to make the vibration stable.Relevant log output
No response