'Receive "Siri remote" event in background on tvOS
I have made a radio player for tvOS and I wan't the audio stream to keep playing while in background. All this works nicely and was pretty easy.
However I would like to stop the stream/audio if "play/pause" button is pressed while in background. But I can't figure out how to do this. I only want it to stop, not pause. This is how Apple Radio works.
I'm handling all my input with Press events and Actions, setup from the interface builder. What I've found so far is how it works on iOS, and I've been suggested to use, but remoteControlReceivedWithEvent is never called (not even in foreground).
Any help on this is highly appreciated, especially if you've had the luck with implementing it yourself ;)
UIApplication.sharedApplication().beginReceivingRemoteControlEvents()
override func remoteControlReceivedWithEvent(event: UIEvent?) {}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
