CHHapticDeviceCapability.supportsHaptics returns false with paired controller

I initially encountered this problem by trying to play games that supported controller haptics, but found that I could only get them to work on my iPhone – not my iPad Pro. When I explored the issue, I determined that this is likely because Core Haptics behaves incorrectly in this case.

Here's the behavior:
When using an iOS device that doesn't support haptics (ie iPad Pro) connected to a paired controller that supports haptics (ie PS4 Dualshock), CHHapticDeviceCapability.supportsHaptics returns false.

Here's the Radar:
rdar://FB8953635
openradar.appspot.com/radar?id=5063321564741632
Answered by in 655545022
The documentation is unfortunately not clear on this: supportsHaptics means "supports internal haptics", which currently distinguishes iPhones from all other device types. Since all device types which support the CoreHaptics framework (iPhone, AppleTV, Mac) also support GameControllers, you should use the existing documented system for establishing a CoreHaptics connection with an external controller to determine if there is one or more available.

Thank you for taking the time to file a radar - this makes such issues much easier for us to track.
  • DS

Accepted Answer
The documentation is unfortunately not clear on this: supportsHaptics means "supports internal haptics", which currently distinguishes iPhones from all other device types. Since all device types which support the CoreHaptics framework (iPhone, AppleTV, Mac) also support GameControllers, you should use the existing documented system for establishing a CoreHaptics connection with an external controller to determine if there is one or more available.

Thank you for taking the time to file a radar - this makes such issues much easier for us to track.
  • DS

Accepted Answer
Got it, thank you for the helpful reply! The behavior you describe makes sense, but has unfortunate side effects given that the docs have always instructed developers to check supportsHaptics before attempting a call to Core Haptics:

By checking for haptic support early using supportsHaptics, you can set a global Boolean that your view controllers can quickly consult before deciding to play a haptic. If this variable is set to false, then the app can proceed without even attempting a call to Core Haptics. For an example of conditioning haptic playback on this global Boolean, see Playing a Custom Haptic Pattern from a File.
Based on whether or not the user’s device supports haptics, your app can decide to use a different codepath, with stronger audio or other multimedia alternatives for feedback.

It would seem that many games are following this advice, as I have tried several where haptics work on a controller paired on iPhone but none that work with a controller paired on iPad.
CHHapticDeviceCapability.supportsHaptics returns false with paired controller
 
 
Q