How to find a call is unanswered in iphone - iphone

If i make a call from an application using
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://1234567890"]];
How can i check if the call is answered or unanswered
Thanks,

You cannot check this. When this URL is opened your application will be closed and phone app will be launched. Since you cannot access calls data from your app there is little you can do. This may be possible in jailbroken iPhone.

Pop up a dialog when the app re-opens asking the user if the call went through. You better have a good reason for wanting to know though or the user will be mighty annoyed!
Otherwise you are out of luck.

Not an iPhone app developer but is it possible to query the phone log the next time the app loads and check time on call or something and if it is over 20 seconds consider it completed or something like this?

There is no access to the iPhone phone from third party software. Luckily.
you can reffer
How can I check missed call in iPhone using Objective-C?

Related

Start my iPhone app on the end of call

I want to develop an app which records the call-duration etc.. when a call is finished. So is it possible to start my app when the user finishes his call.
App is currently not running and then
User Finishes his Call ---> My app should open up the moment he finishes his call giving me the details about call duration etc.. and then i ask for some comments on that page and exit the app.
I already made such an app in Android,Blackberry.
P.S: Even if it works on a jailbroken iPhone it is good enough for me.
There's no way to do this on a regular iPhone. Apple's APIs don't allow you to interfere with phone calls at all.
Not sure about jailbroken phones though. In theory, you can do anything, it just depends on how much time you're willing to spend on it. Good luck.

How to send my app in foreground after a Facetime (integrated) call?

I'm trying to integrate Facetime in my app so basically what I would like to do is to press a button making a call and when it finishes come back to my app. I know that for the time being there are no public API for Facetime.
What I'm doing at the moment is to use Facetime scheme:
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: #"facetime://"]];
I have two questions:
Is it possible to use in the openURL above the string "facetime://" in order to choose who I want to call in Facetime?! I tried it but what happens is that Facetime is run but without its layout so basically I see myself on the screen but I cannot do nothing.
If not point 1 therefore I use for example "facetime://steve#apple.com" is it possible to come back to my app once the call is finish?! I read about multitasking but I don't know how to manage it in this situation.
Thanks in advance
Alex
To anser your second question, NO just like when your app start a call there is no way to get your app back in the foreground after you close the call.
For your first question, you need to add the contact data (e-mail or phonenumber).
Also be aware that the facetime:// url scheme will work on any iPhone/iPod Touch even if they can't do facetime. If the device does not have facetime support it will just show a blank screen.

Incoming call wakes iOS background App?

is it possible to wake an App in the background up, when a call comes in, and access CoreTelephony to send some infos over the web?
I'm practically a n00b in iOS development right now, but got asked a question if iOS is capable to do this. I searched in the iOS reference too, but with no luck.
It would be great if someone with more experience could answer it. Thanks a lot!
Steno
Please, have a look at the document about executing code in the background.
If you go to section "Implementing a VoIP Application", you will see that it is actually possible for your app to be awaken periodically so that it can check if it has anything to do (in your case, if I understand you correctly you would use CTCall to check for calling state).
So, basically, when awaken, your app could check for any incoming call and then use Core Telephony, as you say.
The only trouble about this is that if your app cannot be considered to a a VOIP app, Apple will not let it into the App Store.
It is not possible to have your code run when a call is received.

recognize that user call somebody

how to regognize that user call somebody from code?(means i have an app and want to do sth when user call somebody)
You can't do that I'm afraid, firstly your app won't be running when they are calling someone and secondly you can't access the phone functions from the SDK. Might be possible with a background process on a jail broken phone.
This is not possible, not through code nor through notifications. You can't do anything to stop this, when a phonecall comes in, your application gets suspended, like as if you'd press home in iOS 4 and it will multitask if it has been programed to do so. Have a look at the UIApplication implementations for multitasking and do your work there.

How to programmatically exit from an iPhone application?

I have an iPhone application which will exit on it's own after a user completes a particular action. I currently use exit(0) to leave the application and I have had no troubles with it until recently. I understand that this isn't the "right" way to exit an application but it is something that I want to do. The issue I am having is when the device awakes from hibernation, with my application as the active one, exit(0) is called and the application would restart after exiting.
This strikes me as quite odd and am wondering if this is a bug or am I doing something wrong? Is there a better way to gracefully exit an application without having the user hit the home key?
Thanks
Apple's way is to alert the user that the app is finished and they must click home to quit. You shouldn't do this in your code. If its obvious that your app is quiting to reviewers then it most likely won't get approved.
You can use this private command to quit your app with an animation (after you added the UIApplicationExistsOnSuspend key in your Info.plist) :
[[UIApplication sharedApplication] suspend];
But your app will be rejected if you want to put it in the App Store
There is a link here where may be have your answered: link text
But it doesn't exist public API to terminate programmatically your iphone application. (see Technical Q&A QA1561 from the iPhone Dev Center)
I see the same issue. I was able to stop this by calling exit(1) instead.
//#step invoke the normal routine applicationWillTerminate
if ([[UIApplication sharedApplication].delegate respondsToSelector:#selector(applicationWillTerminate:)])
{
[[UIApplication sharedApplication].delegate performSelector:#selector(applicationWillTerminate:) withObject:[UIApplication sharedApplication]];
}
//#step force quite app
kill(getpid(), SIGINT);
I think that is no private API was used ....