Hello,
I am currently implementing ads for a free version of my app, and noticed that even if I leave the app for a short time after clicking on an ad, when I come back, the app totally restarts, showing the loading screen and everything. I know I could save the game state and recreate it on load, but short of that, what is it that determines how long your app will persist in the background?
What is it that makes your app persist or not when you leave the app and return?
(10 posts) (7 voices)-
Posted 5 months ago #
-
As far as I know, if you have enabled multitasking support to your app, it's up to the operating system to decide which app should be terminated in order to recover additional memory spaces, when it is in need of more memory. That's how iOS's multitasking works.
Posted 5 months ago # -
Also, you might want to also check your crash logs. If the OS thinks you're backgrounding badly (continuing to use OpenGL in the background, etc.), it will terminate you. It could be an issue with your background support.
Is your app actually being terminated? You don't see it in the background apps list anymore?
Posted 5 months ago # -
No, it is still in the background apps list (if you mean the one where you double-click the home buttong). If I leave it for quite a while without clicking on an ad, it has no problems, but if I rush back after viewing the ad, half of the time the game starts over. The device I am testing on is mostly full, I will wipe half of it and see if that changes anything.
I am using AdWhirl with iAd, AdMob, and house ads.
Thanks for the ideas!
Posted 5 months ago # -
@kathers: Keep in mind that the "background apps list" as you called it is not truly what is still in the background. Some of the apps might still be alive in the background, but they are not removed from that list when they are killed. Turn off your device (full power off) and back on. The list is still there.
The symptoms you describe sound like the multitasking code that fires off when it goes into the background might be conflicting with the "wake up" code. (Sorry, not at my Mac - don't recall exactly the method names) I'm not familiar with AdWhirl, but it sounds like their controller might be a little slow to respond when it is going to the background. I'd suggest checking their boards (or Google it) to see if this (bad) behavior is in common with other AdWhirl-integrated apps.
Posted 5 months ago # -
That list really isn't at all a list of running apps, as far as I can see it. Every time you restart, the list fills up with all your apps for instance. I think it's more of a list of available apps, and Apple just made it very confusing by a) not showing which ones are actually running and b) still removing apps you manually turn off from the list temporarily.
As for the problem, I concur about the logs: Run the app in debug mode with the console up and check what happens when you click the home button (without clicking the app again). If it crashes right there, you have your starting point for debugging it :)
Posted 5 months ago # -
Most likely, because this happens with ads the memory goes above 24 mbs which is usualy memory warning level 2 on an sd device at which point if the ios decide it will crash you app. You will most likely get a SIGABRT with an error like message from device 0.
Posted 5 months ago # -
This is not list of "available" apps, or "running" apps. This is simply a list of recently used apps ;)
iOS decides when to kill backgrounded app depending of free ram. If you, for example starts "memory hungry" app ( mostly some 3D high-end game ) it could kill almost everything else ( especially on 256MB multitasking-capable devices: iPhone 3GS, iPod 3gen, 4gen and iPad 1 )
In other side: maybe your app took to much memory and system kills it right after shutdown ? Check it. ( but first try @Scryb advice about debugging )
Posted 5 months ago # -
If I recall correctly, isn't the 24 MB (for older devices) apply only for textures used in your game? The ads displayed outside the app shouldn't affect that.
Posted 5 months ago #
Reply
You must log in to post.