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 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.
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?
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.
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.