In an iOS app, I have an interaction where I want to play both a tap sound:
AudioServicesPlaySystemSound(1104)
and a light haptic:
self.feedbackGenerator = [[UISelectionFeedbackGenerator alloc] init];
[self.feedbackGenerator prepare];
//then later
[self.feedbackGenerator selectionChanged];
This works fine, except when the user's Sounds->System Haptics setting is off. In that scenario, the sound plays much louder than it should. If I remove the haptic call from the code, the sound plays normally.
I've confirmed the above on an iPhone 11 Pro/iOS 14.4.1, but I have reports of this on other iOS 14 iPhones. One tester with iOS 13 didn't experience the problem.
Order of the sound/haptic doesn't change the result.
If I delay one or the other by 0.25s everything works fine, but that delay is too lengthy (doesn't sound or feel right). If I use a very short delay (like 0.01s) the problem occurs.
Per iOS: How to check is Haptic Feedback enabled (iOS Settings), there is no ability to detect the status of the System Haptics setting, else I'd skip the haptic step if disabled.
Apple provides this, indicating sounds and haptics should work together:
If you want to include sound along with the haptic feedback, you need to manually play the sound and sync it with the haptics. - https://developer.apple.com/documentation/uikit/uifeedbackgenerator
Any idea what's going on here? Expected behavior? iOS bug? Workaround?