0

Trying to have a second haptic fire after a first one. However, for some reason the second one does not fire. I added DispatchQueue function to see if it was because they were firing so close together, but it still does not work.

        WKInterfaceDevice.current().play(WKHapticType.stop)
        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
            WKInterfaceDevice.current().play(WKHapticType.notification)
        }
Jet59black
  • 129
  • 1
  • 15
  • `.now() + 1` is in 1 nanosecond after the first one, so they are still too close to each other. Try `.now() + .milliseconds(N)` with different Ns, so offset will be bigger – abjurato Jun 27 '17 at 11:03
  • @abjurato I tried your recommendation with `.milliseconds(3000)` Apparently, the second haptic (.notification) only plays while I have the watch awake in the foreground, but not in the background (when screen is off). – Jet59black Jun 27 '17 at 21:09
  • "By default, you cannot play haptic feedback in the background. The only exception are apps with an active workout session." - https://developer.apple.com/documentation/watchkit/wkinterfacedevice/1628128-playhaptic – abjurato Jun 28 '17 at 06:22
  • @abjurato my app is a workout app, and the haptic is playing during the active workout session. – Jet59black Jun 28 '17 at 10:33

0 Answers0