Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 2, 2009, 07:31 PM   #1
milktooth
macrumors member
 
Join Date: Oct 2009
Do phone calls kill apps?

No. People do.



I only have an iPod touch and don't have access to an iPhone. I'm writing a countdown timer app but have concerns that incoming calls would interrupt its function.

What happens when phone calls are received or made? Are apps left running in the background?

Would an [NSTimer scheduledTimerWithTimeInterval...] be interrupted?
milktooth is offline   0 Reply With Quote
Old Nov 2, 2009, 07:32 PM   #2
GoCubsGo
macrumors Nehalem
 
GoCubsGo's Avatar
 
Join Date: Feb 2005
No apps run in the background of a non-jailbroken iPhone.
GoCubsGo is offline   0 Reply With Quote
Old Nov 11, 2009, 03:59 PM   #3
milktooth
Thread Starter
macrumors member
 
Join Date: Oct 2009
From Apple:

Even if your application is not designed to use iPhone-specific features like the camera, GPS, or Compass, when it runs on an iPhone it can encounter a number of unique situations. For instance, if a user accepts an incoming phone call while using your application, your application will quit. It must be prepared to handle this behavior. The right thing is to restore the user's state when they relaunch the application.
milktooth is offline   0 Reply With Quote
Old Nov 11, 2009, 06:15 PM   #4
xsmasher
macrumors regular
 
Join Date: Jul 2008
Quote:
Originally Posted by milktooth View Post
I only have an iPod touch and don't have access to an iPhone. I'm writing a countdown timer app but have concerns that incoming calls would interrupt its function.

What happens when phone calls are received or made? Are apps left running in the background?
You can use the timer in the "clock" app to simulate an interruption. If the user gets a call you get applicationWillResignActive, if they decline the call you get applicationDidBecomeActive, and if they take the call your app gets terminated.

To simulate this, set a clock alarm for one minute and start your app. When the alarm window appears, you can click "ok" to simulate ignoring the call, or click the home button to simulate taking the call.
xsmasher is offline   0 Reply With Quote
Old Nov 11, 2009, 06:22 PM   #5
mkrishnan
Moderator emeritus
 
mkrishnan's Avatar
 
Join Date: Jan 2004
Location: Grand Rapids, MI, USA
Sorry for butting in, I'm not a programmer, but I wondered... how is it that there were some programs in the past that could stay in a locked/paused state when a call came in? Gameloft's Ferrari GT -- this is an older game now -- could definitely do this.
__________________
Mohan
mkrishnan is offline   0 Reply With Quote
Old Nov 11, 2009, 06:55 PM   #6
xsmasher
macrumors regular
 
Join Date: Jul 2008
Quote:
Originally Posted by mkrishnan View Post
Sorry for butting in, I'm not a programmer, but I wondered... how is it that there were some programs in the past that could stay in a locked/paused state when a call came in? Gameloft's Ferrari GT -- this is an older game now -- could definitely do this.
You "fake it" by pausing the game when you lose focus, and saving the game when you get the termination message. When the game is started again, you look for a saved game file and load it if it exists. That's What I do in "Dead Panic."
xsmasher is offline   0 Reply With Quote
Old Nov 11, 2009, 07:12 PM   #7
mkrishnan
Moderator emeritus
 
mkrishnan's Avatar
 
Join Date: Jan 2004
Location: Grand Rapids, MI, USA
Quote:
Originally Posted by xsmasher View Post
You "fake it" by pausing the game when you lose focus, and saving the game when you get the termination message. When the game is started again, you look for a saved game file and load it if it exists. That's What I do in "Dead Panic."
That's possible, but it doesn't seem to be what that old app did -- now granted, this was some time and a number of OS revisions ago. It came back pretty instantly in paused mode (as opposed to any loading delay). I'd be curious to load it back on my iPhone and see if it still does this.
__________________
Mohan
mkrishnan is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Woman calls for ambulance for diabetic, police arrive and shoot to kill jnpy!$4g3cwk Politics, Religion, Social Issues 3 Oct 10, 2013 11:22 AM
Phone randomly not receiving phone calls papa8706 iOS 7 184 Aug 2, 2013 09:39 AM
Phone Calls Coming in as 2 Separate Calls azzurri13 iOS 7 1 Jul 12, 2013 03:10 PM
iPhone: Looking for tweak to kill notifications while on the phone Heavy Fluid Jailbreaks and iOS Hacks 5 Apr 3, 2013 09:06 PM
Any Cydia tweaks/apps to block numbers? (Like phone calls and SMS?) Johnny Steps Jailbreaks and iOS Hacks 1 May 30, 2012 10:46 AM

Forum Jump

All times are GMT -5. The time now is 12:39 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC