0

Is it possible to launch an application at the end of phone call or after sending SMS?

Satyam
  • 15,493
  • 31
  • 131
  • 244

3 Answers3

1

NO this is not at all possible. Because you cant get the event when the call is ended or message is sent. So theres no way you can open up the application.

Happy Coding...

Jasarien
  • 58,279
  • 31
  • 157
  • 188
Suresh Varma
  • 9,750
  • 1
  • 60
  • 91
  • The code below works (it's ugly, yeah...) - user returns to the app if the call is invoked from the web view. – joshis Aug 24 '11 at 16:25
1

I got this code from Apple site and it works perfectly:

- (IBAction) dialNumber:(id)sender{

    NSString *aPhoneNo = [@"tel://" stringByAppendingString:[itsPhoneNoArray objectAtIndex:[sender tag]]] ;
    NSURL  *url= [NSURL URLWithString:aPhoneNo];

    NSString *osVersion = [[UIDevice currentDevice] systemVersion];

    if ([osVersion floatValue] >= 3.1) {
        UIWebView *webview = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
        [webview loadRequest:[NSURLRequest requestWithURL:url]];
        webview.hidden = YES;
        // Assume we are in a view controller and have access to self.view
        [self.view addSubview:webview];
        [webview release];
    }
    else {
        // On 3.0 and below, dial as usual
        [[UIApplication sharedApplication] openURL: url];          
    }

    //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:aPhoneNo]];

}
iProgrammer
  • 3,099
  • 3
  • 33
  • 59
Dilip Rajkumar
  • 7,006
  • 6
  • 60
  • 76
0

Looks like it might help ..

iPhone SDK: Launching an app after call ends

Community
  • 1
  • 1
wmitchell
  • 5,665
  • 10
  • 37
  • 62