Core Haptics

RSS for tag

Add customized haptic and audio feedback to your app using Core Haptics.

Core Haptics Documentation

Posts under Core Haptics tag

4 Posts
Sort by:
Post not yet marked as solved
1 Replies
177 Views
Hello, I've encountered a concerning issue while working with Core Haptics which I believe warrants attention from the community and Apples engineering team. When attempting to play a haptic pattern using the ChHapticEngine.playPattern method with a corrupted AHAP file path, I've observed unexpected behavior. Specifically, the player is immediately destroyed, triggering the notifyWhenPlayersFinished callback with nil error before executing the catch block(catch block is eventually executed), Furthermore, this behavior introduces ambiguity regarding the successful playback of haptic patterns, as corrupted files can produce false positives in error notifications. Current workaround is simple, AHAP files are JSON formated files at the end of the day, so just try to decode data or create Foundation object from given JSON data. and if this fails then data must not be in expected format(or decoding strategy is off), that way you can guarantee the validity of an AHAP file before passing it to your player. Michaud Reyna, Senior iOS Engineer
Posted
by Mreyna.
Last updated
.
Post not yet marked as solved
2 Replies
459 Views
Hi, I have implemented Core Haptics into a Unity app but there are some unexpected behaviours. I followed the documentation on GitHub and did not get any errors while implementing it. My issue is core haptics giving errors on iPhone 11. iOS 16.7 but works perfectly on iPhone 13 and iPhone 14 pro. This is the error code I am getting in logs: [hapi] HapticDictionaryReader.mm:44 -[HapticDictionaryReader readAndVerifyVersion:error:]: ERROR: Unsupported version number: 10.0 2023-11-20 18:20:01.040069+0300 *** - Game599:12190] Error occurred playing JSON one-shot: Error Domain=com.apple.CoreHaptics Code=-4809 "(null)" CHException: Exception of type 'Apple.CoreHaptics.CHException' was thrown. at Apple.CoreHaptics.CHHapticEngine.PlayPattern (Apple.CoreHaptics.CHHapticPattern ahap) [0x00000] in <00000000000000000000000000000000>:0 at ButtonController.OpenCenterPanel (UnityEngine.Transform panel) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Events.UnityEvent.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.PointerEventData pointerEvent, System.Boolean pressed, System.Boolean released) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.EventSystems.StandaloneInputModule.Process () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() UnityEngine.EventSystems.StandaloneInputModule:Process() It says unsupported version number: 10.0 I do not know why. For the context I play haptic patterns like this example: HapticEngine.PlayPatternFromAhap(_hitAHAP); How can I solve this problem?
Posted
by theleroks.
Last updated
.
Post not yet marked as solved
9 Replies
4.5k Views
Is it possible to customize haptics on Apple Watch (something like CoreHaptics) rather than using standard haptics out of WatchKit? I'm looking for a way to play a continuous waveform (like a more complex version of Breathe).
Posted Last updated
.
Post not yet marked as solved
1 Replies
729 Views
Cannot find 'UINotificationFeedbackGenerator' in scope - Getting this error with Xcode 14.3 watchOS project. Using SwiftUI and Xcode 14.3.1 Already imported UIKit import UIKit let notificationGen = UINotificationFeedbackGenerator() Similar issue with WKInterfaceDevice also. try WKInterfaceDevice.current().play(.click) Error: Cannot find 'WKInterfaceDevice' in scope
Posted
by Jobs007.
Last updated
.