ApplicationResume in iOS always restarting App

Here is my code located in Main.lua:

local   function    onSystemEvent (event)
    --print (event.name…", “…event.type)  --example: system, applicationStart
    local t=event.type
    local n=event.name
    if t==“applicationExit” or t==“applicationSuspend” or t==“applicationResume” then
       showDeveloperInfo(“EventName:”…n…”, EventType:"…t)

    end
end

Any idea why my ApplicationResume in iOS 8.3 always restarts the App, even when all I do is try to come back to the App in memory after running another App? This is the same behavior which occurs when I click on the App to start it, even if it is already in memory.

Hi @troylyndon,

Did this just start occurring in 8.3? As in, was the exact same app with no edits behaving differently in <= 8.2, and now suddenly something changed in 8.3?

Thanks,

Brent

I don’t think so. I just happen to be running 8.3 now.

Hi @troylyndon,

Can you post the contents of your build.settings file for me?

Thanks,

Brent

Sorry about the delay, Brent. This is my first iOS game - I noticed that I have the following in my build.settings file:

UIApplicationExitsOnSuspend = true

My app does not exit when I go to another app, so I’m thinking this setting is correct. Am I right? I have no other related settings in my build.settings file. Any suggestions?

Hi @troylyndon,

Yes, that will cause your app to exit on suspend, assuming it’s located in the proper place (table heirarchy within build.settings). If your app is not exiting on suspend even with that line, then it’s probably not in the proper location.

Generally, we recommend that you remove that. Only rarely do you want the app to exit every time it is suspended. Yes, there are some cases where you may want that, but it’s uncommon (hence why the default is false).

Best regards,

Brent

Hi @troylyndon,

Did this just start occurring in 8.3? As in, was the exact same app with no edits behaving differently in <= 8.2, and now suddenly something changed in 8.3?

Thanks,

Brent

I don’t think so. I just happen to be running 8.3 now.

Hi @troylyndon,

Can you post the contents of your build.settings file for me?

Thanks,

Brent

Sorry about the delay, Brent. This is my first iOS game - I noticed that I have the following in my build.settings file:

UIApplicationExitsOnSuspend = true

My app does not exit when I go to another app, so I’m thinking this setting is correct. Am I right? I have no other related settings in my build.settings file. Any suggestions?

Hi @troylyndon,

Yes, that will cause your app to exit on suspend, assuming it’s located in the proper place (table heirarchy within build.settings). If your app is not exiting on suspend even with that line, then it’s probably not in the proper location.

Generally, we recommend that you remove that. Only rarely do you want the app to exit every time it is suspended. Yes, there are some cases where you may want that, but it’s uncommon (hence why the default is false).

Best regards,

Brent