使用按钮和文本字段/视图(iPhone)打开电话(呼叫),然后返回到应用程序

时间:2011-12-01 12:44:51

标签: iphone

您好,我已经成功开发了一个应用程序,在UITextField中拨打UIButton the Mobile no。

但我无法回复我的申请表。是否可以返回我拨打手机号码的页面。

-(void)newuser:(id)sender;
{
    NSString *URLString = [@"tel://" stringByAppendingString:@")172-123456"];

    NSURL *URL = [NSURL URLWithString:URLString];

    [[UIApplication sharedApplication] openURL:URL];
}

谢谢

2 个答案:

答案 0 :(得分:2)

不,接收要处理的URL的应用程序无法获取有关发件人的信息。此外,据我所知,Phone应用程序也没有Back按钮。

答案 1 :(得分:1)

不确定这是在哪个iOS版本中实现的,但是我在我的最新应用程序“App Time”中使用这个简单的方法,即从UIWebview中启动调用,但不需要更多...

     UIWebView *webView = [[UIWebView alloc] init];
     NSURL *telURL = [NSURL URLWithString:@tel://yourNumber"];
     [webView loadRequest:[NSURLRequest requestWithURL:telURL]]; 

提示用户使用UIAlertview确认呼叫,但在呼叫完成后将返回到同一屏幕。