OnApplicationPause not being called in iOS build

I am currently using Unity 5.5.1p2 and I have looked in dozens of places and cannot seem to figure out why this is happening.
I am trying to get OnApplicationPause to work (in two scripts) but when I run on my iOS Devices I do not get any logs from the function.

Is this broken?? I need to have this function working.

Thanks in advanced

EDIT : Apparently, it was not working because I had ‘Behaviour in Background’ set to Custom instead of Suspend…
How can I get this to work if ‘Behaviour in Background’ is set to Custom??

1 Like

Maybe this: Unity - Scripting API: MonoBehaviour.OnApplicationFocus(bool)

I’ve not tested it, but it’s a thing.

Yes, That does work. However, for my needs I need to have OnApplicationPause rather than OnApplicationFocus

Thanks d34thst4lker, I had the same problem. I wasn’t aware that setting that to Custom would entirely prevent your app from receiving OnApplicationPause events.

Facing the same problem.

Did you ever figure out how this works if ‘Behaviour in Background’ is set to Custom?

Hey! I recognize you @waldgeist from the Meteor forums.

I think this has to do with some more checkboxes in the player settings, XCode and your entitlements.