Hi all,
This question is real beginner one but I noticed in iOS 5 on my iPad that when I return to the iPad home screen via the bottom button that if I look at the applications by double clicking the bottom button my application still shows up in the suspended applications. If I select my application again it starts from scratch. What exactly is going on with those applications? Why isn’t my application exited when I return to the iPad home screen?
Thanks all. [import]uid: 108253 topic_id: 18985 reply_id: 318985[/import]
You didn’t set up your build settings right, I’m thinking.
Make sure this line is included in plist;
[lua]UIApplicationExitsOnSuspend = false[/lua]
It should then resume from where it left off. Setting it to true will start the app from the beginning which some people prefer.
Peach
[import]uid: 52491 topic_id: 18985 reply_id: 73157[/import]
Thank you. That should do it.
Cheers,
-Dennis [import]uid: 108253 topic_id: 18985 reply_id: 73271[/import]
Hi I wonder if you can help with this…
I have an app with a countdown timer… what do I need to do for the timer to continue registering and calling the required functions while the app is suspended in background?
I have set the uiapplicationexitsonsuspend to false but it still pauses and resumes from where it left. I want it to continue counting down while the user is able to answer calls etc, then set off an alarm during exit/suspension or show the correct time when the app resumes.
thanks for any advice.
Tim
edit: I managed to use jon Beebes tutorial to make a variable markTime = os.timer() and put this in the event.type applicationSuspended. Then on applicationResumed I got variable timePassed = os.time - markTime and then subtracted the timePassed from my timer.text.
This works beautifully, except for one thing… I still want the alarm to go off if the time runs out during the app running in background… the timer continues but the functions don’t. is there any way round this??? [import]uid: 131622 topic_id: 18985 reply_id: 107149[/import]
You’d need to use notifications for that - or is that what you are doing? (Sorry, just want to make sure I understand correctly.) [import]uid: 52491 topic_id: 18985 reply_id: 107358[/import]
Hi Peach
thanks for coming back to me so quick. Not using notifications yet, all i have really is an app using story board template with widget tab buttons… 1st view for now does nothing, it will be an intro screen if you like, the second view is a timer for cooking. simple timer, select a preset time and the time starts counting down, when it gets to zero an alarm sounds. I have coded an alarm into the app, I have not used the native alarms, though wondering if this is something I should consider, if so how would I go about it?
As I said it all works fine if the user remains in the app, but should they leave the app, say if they needed to take a call or check emails or something, the app functions pause as it leaves… therefore defeating the point of the timer. I have managed to code the app to count the time it is suspended for, which deducts that time from the remaining time… all works… but if the timer should end while suspended, it does not say so until returning. for example… if there’s 1 minute left when you leave the app, and are gone for 2 mins, the item you are cooking would be ruined because it does not alarm while the user is outside the app… but it does count the time and sound the alarm when coming back to the app.
any ideas? sorry for the lengthy detail. [import]uid: 131622 topic_id: 18985 reply_id: 107414[/import]
http://blog.anscamobile.com/2011/09/local-notifications-now-in-daily-builds/
This is likely the API Peach was talking about. It will allow you to schedule an iOS Notification in X seconds, or at X time. If you are outside the App it will post the notification(with an optional Red icon on your app and sound), and if you are in App you can handle it yourself using a listener.
The idea would be to create a timer and a notification, and if you are in app, rely on the timer, if you are not, you can rely on the Local Notification. [import]uid: 134101 topic_id: 18985 reply_id: 107421[/import]
Wow guys, amazing response. thanks so much. I will try this out it sounds perfect. fingers crossed i can get it working.
[import]uid: 131622 topic_id: 18985 reply_id: 107424[/import]