iphone-在通话结束时启动应用程序

iphone-在通话结束时启动应用程序,iphone,Iphone,是否可以在通话结束或发送短信后启动应用程序?不,这根本不可能。因为您无法在通话结束或发送消息时获取事件。因此,您无法打开应用程序 快乐编码…看起来可能会有帮助 我从苹果网站上获得了这段代码,它运行得非常完美: - (IBAction) dialNumber:(id)sender{ NSString *aPhoneNo = [@"tel://" stringByAppendingString:[itsPhoneNoArray objectAtIndex:[sender tag]]] ;

是否可以在通话结束或发送短信后启动应用程序?

不,这根本不可能。因为您无法在通话结束或发送消息时获取事件。因此,您无法打开应用程序


快乐编码…

看起来可能会有帮助


我从苹果网站上获得了这段代码,它运行得非常完美:

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

}
下面的代码有效(很难看,是的…)-如果从web视图调用调用,用户将返回应用程序。