Running an Http Server in Background in iOS

1.4k views Asked by At

I am currently building an app that serves as an http server for wifi speakers to download and play music from it. I know clearly that app resources are killed after a short time one they gone off to the background. is there any way to maintain the connection between http server and the devices that are fetching data from it? I need a legal way, because this app is to be submitted to the app store. I tried searching over the net, and I found the solutions they provided seems to be likely rejected by apple.

Many Thanks!

1

There are 1 answers

5
Woodstock On BEST ANSWER

You can try and use the Audio and AirPlay background mode available in iOS.

Whether they accept a HTTP server being part of the app only time can tell.

Read more here: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

Failing that other background modes (such as Bluetooth / VOIP) can be used as workarounds but they may not allow during review.