Question

I am making an App where i m running am streaming a radio url. But when the App goes into background it stops running. I want to run it when when the App enter background. Can anyone help me with this.

Was it helpful?

Solution 2

It's simple. You need to register as a background audio app by including the UIBackgroundModes key (with the value audio) in its Info.plist file.

Note: Apps that include this key must play audible content to the user while in the background.

Edit

For Xcode 4.6, go to plist-> Required Background Modes-> App Plays Audio

OTHER TIPS

As suggested by P.J., your app should register for background audio play.

According to the Apple Doc

  • When the UIBackgroundModes key contains the audio value, the system’s media frameworks automatically prevent the corresponding app from being suspended when it moves to the background. As long as it is playing audio or video content, the app continues to run in the background. However, if the app stops playing the audio or video, the system suspends it.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top