Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-11-2009, 02:57 AM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 242
m_kaminsky@yahoo.com is an unknown quantity at this point
Default How do I detect call

Could someone help me? is there a boolean equivalent for "now receiving phone call"?
m_kaminsky@yahoo.com is offline   Reply With Quote
Old 06-11-2009, 05:58 AM   #2 (permalink)
Registered Member
 
macoholic's Avatar
 
Join Date: Dec 2008
Location: around a Mac...in Pune,India :)
Posts: 137
macoholic is on a distinguished road
Default

No no bool variable as such but check the UIApplicationDelegate

You will get a method

Code:
- (void)applicationWillResignActive:(UIApplication *)application
which is invoked in case of interruptions!
macoholic is offline   Reply With Quote
Old 06-11-2009, 10:41 AM   #3 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 242
m_kaminsky@yahoo.com is an unknown quantity at this point
Default

Quote:
Originally Posted by macoholic View Post
No no bool variable as such but check the UIApplicationDelegate

You will get a method

Code:
- (void)applicationWillResignActive:(UIApplication *)application
which is invoked in case of interruptions!

interesting.. I'm wondering how I could use that because I want to
have a general phone behavior of "if the phone rings, and ...then do that"
like , as a background setting...impossible? Can that interuption method be accessed directly? like

if applicationWillResignActive true (

do stuff..

)
m_kaminsky@yahoo.com is offline   Reply With Quote
Old 06-12-2009, 08:37 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 355
Bucky is an unknown quantity at this point
Default

If you implement the applicationWillResignActive: method in your app delegate, the system will trigger it for you when an interruption (such as a phone call happens). ie put everything you want to do when the phone rings in that method. Bear in mind that you won't get long, nor can you block the phone call. If the method takes too long to execute, the system will just terminate your app to let the phone call through.
Bucky is offline   Reply With Quote
Old 06-13-2009, 03:20 AM   #5 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 242
m_kaminsky@yahoo.com is an unknown quantity at this point
Default

Quote:
Originally Posted by Bucky View Post
If you implement the applicationWillResignActive: method in your app delegate, the system will trigger it for you when an interruption (such as a phone call happens). ie put everything you want to do when the phone rings in that method. Bear in mind that you won't get long, nor can you block the phone call. If the method takes too long to execute, the system will just terminate your app to let the phone call through.

Is the applicationWillResignActive a background process or an app? ..If I wanted to invoke say an alert sound if a call is longer than 1 minute?
m_kaminsky@yahoo.com is offline   Reply With Quote
Old 06-13-2009, 07:49 AM   #6 (permalink)
Former NeXTStep Developer
 
Join Date: Mar 2009
Posts: 997
FlyingDiver will become famous soon enough
Default

Quote:
Originally Posted by m_kaminsky@yahoo.com View Post
Is the applicationWillResignActive a background process or an app? ..If I wanted to invoke say an alert sound if a call is longer than 1 minute?
There are no background processes. Your app would have to be running as the current user application to get that notification.

joe
FlyingDiver is offline   Reply With Quote
Old 06-15-2009, 04:07 AM   #7 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 355
Bucky is an unknown quantity at this point
Default

Quote:
Originally Posted by m_kaminsky@yahoo.com View Post
Is the applicationWillResignActive a background process or an app? ..If I wanted to invoke say an alert sound if a call is longer than 1 minute?
No, it's a delegate method. If you don't know what a delegate is, stop. Drop everything and learn about them. NOW!

When a phone call comes through, this method is triggered. The user then has the opportunity to answer the call. If they choose not to answer it, your app continues as normal. If they choose to answer it, the system will quit your app. You also can't find any info about the incoming call before you ask. If this method takes too long, then the system will see this as an attempt to prevent the call, and will kill your app.
Bucky is offline   Reply With Quote
Old 03-13-2010, 04:10 PM   #8 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default Your app terminates when a phone call comes in

Quote:
Originally Posted by m_kaminsky@yahoo.com View Post
Could someone help me? is there a boolean equivalent for "now receiving phone call"?
I can tell by your questions that you haven't faced the hard reality of iPhone development yet: There are no background processes.

If the phone rings, your app gets a terminate notice, and has a fraction of a second to clean up before it gets terminated. When the phone call ends, you will get launched again, so you get a chance to restore your app to the state it was in when the phone call arrived, but that is the extent of it.

While a phone call is going on, you are as good as dead. The user can put the phone call into the background and launch your app again, but only Apple apps are able to run in the background.


Regards,

Duncan C
Duncan C is offline   Reply With Quote
Old 05-09-2010, 06:15 PM   #9 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 5
joby1 is on a distinguished road
Default wrong

That is true if a call comes in.

What about if a user makes a call, presses the home button then launches an app?

This is very possible, so you can run an app during a call.

Is there any way to detect if a call is currently going on? It would help for me on project.
joby1 is offline   Reply With Quote
Reply

Bookmarks

Tags
detect call

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 333
8 members and 325 guests
chiataytuday, givensur, ipodphone, jbro, mer10, mtl_tech_guy, Punkjumper, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,113
Posts: 402,881
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:12 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0