0

I am able to call from my iphone application by using below code:

  NSString *phoneNumber = @"tel://1234567890";
  [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

Now, i want to know how to return to my application back when the call ends ?

user601367
  • 2,308
  • 12
  • 34
  • 44
  • As far as I'm aware, such interaction is impossible since your application has been demoted to background, and all UI interaction has been delegated to the Phone app, and the user. – J. Steen Jul 21 '11 at 11:04
  • As far as I know, there is no way to do that. – dasdom Jul 21 '11 at 11:05

5 Answers5

2
    UIWebView *phoneCallWebview = [[UIWebView alloc] init];
   // [self.view addSubview:phoneCallWebview];
    NSURL *callURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", 9238928399]];
    [phoneCallWebview loadRequest:[NSURLRequest requestWithURL:callURL ]];
1

As far as I'm aware, such interaction is impossible since your application has been demoted to background, and all UI interaction has been delegated to the Phone app, and the user.

J. Steen
  • 15,470
  • 15
  • 56
  • 63
0

From iOS 5, use below...

NSString *phoneNumber = [@"telprompt://" stringByAppendingString:@"12345678"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
0

Just use telprompt:// instead of tel://

telprompt will prompt the user first, and when call ends,it will go back to your application.

NSString *myNumber = [@"telprompt://" stringByAppendingString:txtMobileNo.titleLabel.text]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:myNumber]];

nilam_mande
  • 931
  • 7
  • 14
0

I found this SO question

End call, don't return to app automatic in iphone 3.1 version

Which pointed to an article on apple dev forums

https://devforums.apple.com/message/128046 (dev account required)

Which says it was a change in iOS 3.1 but a "workaround" is

use UIWebView to open the tel: url, after the call, your app will relaunch, but you get the annoying do you want to make this call alert.

I have't verified this works as described, just thought I'd point it out

Community
  • 1
  • 1
JeremyWeir
  • 24,118
  • 10
  • 92
  • 107