How to Build an App: iOS Background Audio Controls

Allowing your app to receive remote audio control events is pretty easy.

The gist of it is to just tell the OS you’re interested in being told of the events. Then you just have a callback for the events and you can act on them.

For the view controller that’s playing music, you can declare interest in receiving the events in the viewWillAppear: method like this…

Do the reverse in the viewWillDisappear: like this…

Then you’re ready to handle the events…

See details here in Apple documentation.