continue running app in background for audio generation (iOS) ?

Hi.

An important feature of my Unity app is to continue running in the background after the person has pressed the HOME button.

iOS allows this to happen, even with OpenGL apps, provided:

  • The app is designated as requiring background execution (eg, audio app).
  • The app does not make OpenGL calls whilst in the background.

However Unity does not allow this to happen, as pushing the HOME button gracefully suspends the app. This occurs regardless of how the Info.plist is configured (eg, designating the app as an audio app that should continue in the background).

This poses a question.

Does anyone have thoughts on how Unity could be forced to continue background execution, given that it appears to be intentionally preventing background execution at present?

I have spent a week trying to modify the XCode project to this effect, although I have not managed to keep Unity executing.

It should be noted that my app uses the physics side of Unity to trigger Audio; customers are constantly requesting the ability to play the app in the background, although my hands are tied by what Unity allows.

Any thoughts/clues/comments aimed at making Unity run in the background would be extremely appreciated.

Thanks :slight_smile:

Has there been any luck on this front? I would love to have background audio keep running in an app I’m currently working on.

@OneThree

In spite of me spending more time with this since I created the post, I’m yet to make any progress. I’m pretty convinced that unless Unity add the functionality, it simply isn’t possible.

Amazingly, you are the only person to ever respond to this post. I thought others would have been doing similar things as I am with Unity (not just making games which run in the foreground).

What I really need, is the phone number for the Unity devs, that’s my next avenue :slight_smile:

Am another developer needing this, where you are incorrect above is that unity does not gracefully suspend the app when audio is playing, frequently it crashes in such a way as to indicate time has stopped in the engine. As a result I use th kill on suspen option. Anyway would b good if unity could fix this; bu for now I haven’t seen a fix to an audio bug in a long time
M

For what task you need the app to be in the background? only the audio? Apple has its own requirements for apps running in the background and what functions they need to use when backgrounded. If I recall correctly its already been said that the way Unity is done and to maintain decent cross-platform stuff its not possible to use Unity audio engine for any background tasks and you must roll out your own code via objc to do things way Apple wants and just pause Unity.