Our watch app, Regatta Timer, is a specialised countdown timer for sailing competitions. It is crucial that the beeps & haptics continue when 'wrist down' on alway on displays. We tried to enable this by adding 'background mode' but that only works in the Xcode Apple Watch simulator, not on an actual device with always on display. Any idea how we can get this working also on the Apple Watch device?
In ContentView.swift we currently added this code:
WKInterfaceDevice.current().play(sound)
}
but that doesnt work - regardless of adding
, phase == .active`
or not.
STEPS TO REPRODUCE
- Install on an ACTUAL DEVICE with always on display
- start the countdown timer: beeps & sounds are OK (each minute,...)
- do 'wrist down': the countdown timer continues on the dimmed display, but the sounds & haptics stop working until you raise your wrist to wake up the display.
This is an as-design behavior, as described in the API reference of WKInterfaceDevice.play(_:):
By default, you cannot play haptic feedback in the background. The only exception are apps with an active workout session. For more information, see Running workout sessions in HKWorkoutSession.
In your case, even though your app's UI is still on the screen because of the always-on mode, your app will transition to background after you lower your wrist (and eventually be suspended if it isn't doing any background session). Playing sounds or haptics in that situation isn't allowed.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.