What's the method that gets called when the user press the end call button while making a phone call and how to use it in my app? Thank you
Asked
Active
Viewed 738 times
-1
-
1What are you trying to do? Are you trying to have your app terminate a phone call (not possible) or are you trying get a notification when the call ends? – BergQuester Sep 16 '13 at 01:08
-
It's not possible :/ Thank you – Georgio Sayegh Sep 16 '13 at 02:49
2 Answers
1
Your app cannot end user's phone calls for them, just as it can't make phone calls.
If there were a method it would be part of CTCall
. There isn't one.

Tommy
- 99,986
- 12
- 185
- 204
-
Um, you can make phone calls in iOS.... I even have an app in the app store that does it. The user does have to authorize your app to make calls and it gets passed to the standard phone app though. http://stackoverflow.com/questions/4929717/how-can-i-make-a-phone-call-programmatically-on-iphone – BergQuester Sep 16 '13 at 01:07
-
That's not making a phone call — it's just offering up a number. The user has to proactively agree to the call through user interface outside of your control. You cannot programmatically start a call. – Tommy Sep 16 '13 at 04:43
-
It works just the same as getting location data, using push notifications, etc. They only have to authorize the first call. After the app has been authorized the user is not bothered again with the authorization, the call just goes through. I just now double-checked and iOS did just let the app I used make a call with no further prompts. Even if the user had to authorize it every time, I would still say that is close enough to say that yes, an app can initiate phone calls. – BergQuester Sep 16 '13 at 04:48
0
You can make calls from within an app:
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"telprompt://<number>"]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://<number>"]];
} else {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"No Phone" message:@"" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
}
or
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel://<number>"]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://<number>"]];
} else {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"No Phone" message:@"" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
}
The first version will return you to your app and execute your callback function, the second won't. The first version will prompt you with an alert box to make the call, the second won't.

jgoldberger - MSFT
- 5,978
- 2
- 20
- 44