watchos

Does WKHapticType.notification always play a sound when a notification is fired?


I'm trying to build a simple WatchOS app that uses WKHapticType.notification for haptic feedback. However, whenever I use it, there is always some (unwanted) sound associated with each notification. Is there a way to disable the sound?


Solution

  • Specifically using WatchKit to play a haptic with WKInterfaceDevice.play(_:) will always play a sound if the device is not muted.

    I'd suggest using the SwiftUI sensoryFeedback() modifier if this is an in-app haptic. There are a few canned sensory feedback types to indicate general events, or you could create your own with impact(weight:intensity:) if you're looking for a specific feel.