We are using the following code to check for the haptics support on the device
import CoreHaptics
let hapticCapability = CHHapticEngine.capabilitiesForHardware()
let supportsHaptics: Bool = hapticCapability.supportsHaptics
For some reason it returns false
on iPhone 7 not only on my personal device (iOS 13) but some of our users reported the haptic settings missing from our app on iPhones 7 (iOS 15) as well.
I have just checked with this private api call that in fact the devices does support haptics (obviously, it has not physical home button)
extension UIDevice {
var feedbackSupportLevel: Int? {
value(forKey: "_feedbackSupportLevel") as? Int
}
}
let supportsHaptics: Bool = UIDevice.current.feedbackSupportLevel == 2
And it returns true
, as expected.
Weird thing is that the haptics work perfectly fine, it's just the haptics support status is incorrect.
So my question is: will we be rejected for checking the value of the _feedbackSupportLevel
on UIDevice
just to make sure we are correctly displaying available system features for our users on all of the devices?