I am the author of a Cydia tweak called AirFloat. An app that implements the AirPlay audio protocol (previously known as AirTunes), making it possible to stream audio to your iOS device. AirFloat is originally an App Store app, until it got booted by Apple from the App Store.
I've since that made it available for free in Cydia. Currently the app stands in Cydia exactly as the previous App Store version. As a result of this I get a lot of requests to make it work in the background. But I cannot get it to work.
Basically I am thinking of two approaches.
Note: AirFloat displays the currently playing track on the iOS lock screen.
Create a daemon, which runs the actual AirPlay implementation, and communicates with a UI app using notify. This works. Kind of. It runs and plays the audio, but the MPNowPlayingInfoCenter does not seem to be updatable from a non-UI application. Also when the daemon is running as user mobile.
Second approach is to just have it all work in a UI application. But I am having difficulties not having it be suspended. I've set the "Required Background Modes" to audio and continuous. The server might still be running, but then the Bonjour advertising is brought down, because the run loop is brought to a halt when in background. Secondly the app should be launched automatically with SpringBoard and relaunched on abnormal exit.
Personally I prefer the second approach, because I would avoid doing interprocess communication. And for this approach to work I would need full background execution (including run loops) and have it both launched on SpringBoard launch and relaunched on abnormal exit.
Anyone have any suggestions on how to solve this?