Run Unity App in background on mobile

Hi fellow devs,

I want to create a Unity App for Android + iOS which plays an audio file that is pitched by gyrosensor movement (the easy part)

The audio playback and the pitching via gyrosensor should also work when the app is in background / has no focus (the difficult part)

It would be ideal that this can be done INSIDE the project, so there is no additional manual step involved when using Unity Cloud Build.

Any hints appreciated,
Rene

For iOS it is a question whether this is possible at all. IIRC it used to be the case that only music player were allowed to play audio while in background. I’d start from AppStore rules.
In any case you have to stop Unity playback when in background and implement the stuff as a service or whatever it’s called.

@Aurimas-Cernius Thanks a lot for your answer. Apple states in their App Store Review Guidelines under 2.5.4:

Multitasking apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc. If your app uses location background mode, include a reminder that doing so may dramatically decrease battery life.

Anybody got some more elaborated hints on the initial question?

Did you ever figure this out?