Stopping fast app switching

I asked a question last night about problems I am having with fast app switching. I asked a secondary question which is perhaps better suited to a separate thread, so here it is.

I tried using UIApplicationExitsOnSuspend to stop fast app switching to avoid issues, but it disappears from Info.plist whenever I do a build from Unity, even though I am selecting Append.

Am I doing it the right way?

Highlight the bottom line of Info-plist in Xcode.

Press the plus symbol to the right of the line to create a new line.

UIApplicationExitsOnSuspend does not appear on the options, so paste it in.

Right click the right-hand field. Set to Boolean and click to set to on.

Save using Xcode menu.

Xcode throws errors if I try to build directly with my Unity created project (both clean targets and not), so I do a build in Unity. A check shows the new Info.plist line has gone.

Has this option disappeared? Does Unity override it?

Yeah, Info.plist gets overwritten. I always have the previous version open in a separate editor, and after building, I save it there, overwriting the new one.
But you could probably change this in your trampoline project if you want it changed for all your projects.

But are you sure you want to disable this? I think it’s possible Apple will reject your game for not supporting fast app switching, and users could become frustrated, expecting to be able to press home and get back to the game, and then finding that the game has been reset.

I don’t want to disable it if possible. But it is creating a bug that I have no other solution to.

The bug is if I press the home button to get out of the game, then return to the game (I was using the app icon rather than double-clicking Home), I sometimes end up with a second player craft generating, or a second set of enemies, if I exited just after their correct generation.

I doubt I could be hitting the exact frame of generation so regularly for it to be a case of starting at the beginning of the frame again where generation happened.