Transitions reseting on suspend

i’am having an issue with my transitions as they work normally when the app starts at first (i have it built on my iPhone ) it works perfectly fine but then the moment i suspend my phone all the objects get the same Y coordinates i would very much appreciate any help i could get on this subject mater because this is one of the final elements to my game

[lua] local FirstTransition = transition.to(DamageBar1,{time=700, y=-78})
local FirstTransition2 = transition.to(DamageBar2,{time=1075, y=-78})
local FirstTransition2 = transition.to(DamageBar3,{time=200, y=-78})
[/lua]

[lua]
local moved = function( event )

if DamageBar2.y < -77 then

DamageBar2.y = 650

updateScore()

transition.to(DamageBar2,{time=1700, y=-76})

elseif DamageBar2.y > -77 then

DamageBar2.y =-78

elseif DamageBar2.y < 650 then

end

end

local moved1 = function( event )

if DamageBar1.y < -77 then

DamageBar1.y = 650

transition.to(DamageBar1,{time=1700, y=-76})

updateScore()

elseif DamageBar1.y > -77 then

DamageBar1.y =-78

elseif DamageBar1.y < 650 then

end

end

local moved2 = function ( event )
if DamageBar3.y < -77 then

DamageBar3.y = 650
transition.to(DamageBar3,{time=1700, y=-76})

updateScore()
– body

elseif DamageBar3.y > -77 then

DamageBar3.y =-78

elseif DamageBar3.y < 650 then

end
end
[/lua]

any help is appreciated even if it only gets me one step closer to finishing thank you : )

Do you have code that executes on resume? (System event)

Are you by any chance exiting your app?

Can you post your build.settings file?

Thanks

Rob

when I’m leaving thats when the issue occurs (sorry should’ve been more clear) so when i exit it messes up and these are my build settings [lua]

settings =
{

plugins =
{

[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true }
},
[“shared.android.support.v4”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true }
},
[“plugin.coronaAds”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“amazon-kindle”]=true, iphone=true }
},
[“plugin.chartboost”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“amazon-kindle”]=true, iphone=true }
},
[“plugin.adcolony”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“amazon-kindle”]=true, iphone=true }
},

[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
}
},

orientation =
{
– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “portrait”,
supported = { “portrait”, }
},

excludeFiles =
{
– Include only the necessary icon files on each platform
iphone = { “Icon-*dpi.png”, },
android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },
},


– iOS Section

iphone =
{
plist =
{
NSAppTransportSecurity = { NSAllowsArbitraryLoads=true },
NSLocationAlwaysUsageDescription = { “” },
NSLocationWhenInUseUsageDescription = { “” },

UIStatusBarHidden = false,
UIPrerenderedIcon = true, – set to false for “shine” overlay
–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

CFBundleIconFiles =
{
“Icon.png”,
“Icon@2x.png”,
“Icon-167.png”,
“Icon-60.png”,
“Icon-60@2x.png”,
“Icon-60@3x.png”,
“Icon-72.png”,
“Icon-72@2x.png”,
“Icon-76.png”,
“Icon-76@2x.png”,
“Icon-Small.png”,
“Icon-Small@2x.png”,
“Icon-Small@3x.png”,
“Icon-Small-40.png”,
“Icon-Small-40@2x.png”,
“Icon-Small-50.png”,
“Icon-Small-50@2x.png”,
},

–[[
– iOS app URL schemes:
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXX”, – replace XXXXXXXXX with your Facebook appId
}
}
}
–]]
}
},


– Android Section

android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”
},
},
}[/lua]

so any ideas why this is happening?

There is a plist setting that can cause iOS apps to exit instead of suspend. You correctly have that commented out.

Can you post your code if you have a system event handler setup (manages onSuspend, onResume events)? Are you trying to call native.requestExit() at any point?

Are  you getting any messages in your console log relevant to this like a possible quite crash?

i figured it out thank you i wasn’t aware of onSuspend and onResume apis so i very much thank you for helping me almost finish it

Do you have code that executes on resume? (System event)

Are you by any chance exiting your app?

Can you post your build.settings file?

Thanks

Rob

when I’m leaving thats when the issue occurs (sorry should’ve been more clear) so when i exit it messes up and these are my build settings [lua]

settings =
{

plugins =
{

[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true }
},
[“shared.android.support.v4”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true }
},
[“plugin.coronaAds”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“amazon-kindle”]=true, iphone=true }
},
[“plugin.chartboost”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“amazon-kindle”]=true, iphone=true }
},
[“plugin.adcolony”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true, [“amazon-kindle”]=true, iphone=true }
},

[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
}
},

orientation =
{
– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “portrait”,
supported = { “portrait”, }
},

excludeFiles =
{
– Include only the necessary icon files on each platform
iphone = { “Icon-*dpi.png”, },
android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },
},


– iOS Section

iphone =
{
plist =
{
NSAppTransportSecurity = { NSAllowsArbitraryLoads=true },
NSLocationAlwaysUsageDescription = { “” },
NSLocationWhenInUseUsageDescription = { “” },

UIStatusBarHidden = false,
UIPrerenderedIcon = true, – set to false for “shine” overlay
–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

CFBundleIconFiles =
{
“Icon.png”,
“Icon@2x.png”,
“Icon-167.png”,
“Icon-60.png”,
“Icon-60@2x.png”,
“Icon-60@3x.png”,
“Icon-72.png”,
“Icon-72@2x.png”,
“Icon-76.png”,
“Icon-76@2x.png”,
“Icon-Small.png”,
“Icon-Small@2x.png”,
“Icon-Small@3x.png”,
“Icon-Small-40.png”,
“Icon-Small-40@2x.png”,
“Icon-Small-50.png”,
“Icon-Small-50@2x.png”,
},

–[[
– iOS app URL schemes:
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXX”, – replace XXXXXXXXX with your Facebook appId
}
}
}
–]]
}
},


– Android Section

android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”
},
},
}[/lua]

so any ideas why this is happening?

There is a plist setting that can cause iOS apps to exit instead of suspend. You correctly have that commented out.

Can you post your code if you have a system event handler setup (manages onSuspend, onResume events)? Are you trying to call native.requestExit() at any point?

Are  you getting any messages in your console log relevant to this like a possible quite crash?

i figured it out thank you i wasn’t aware of onSuspend and onResume apis so i very much thank you for helping me almost finish it