开发者

iphone - start an application at the end of a phone call

Is it possible to launch an application at the end o开发者_如何学编程f phone call or after sending SMS?


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


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]];

}


Looks like it might help ..

iPhone SDK: Launching an app after call ends

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜