0
我知道如何在iPhone中以编程方式直接从我的应用程序拨打电话,但在调用电话之前,我的应用程序正在终止,这是不应该的,一旦电话退出,我的应用程序就不得不恢复回来。如何以编程方式为iPhone执行此操作?如何从我的应用程序拨打电话,而不必在iPhone中退出我的应用程序?
谢谢。
我知道如何在iPhone中以编程方式直接从我的应用程序拨打电话,但在调用电话之前,我的应用程序正在终止,这是不应该的,一旦电话退出,我的应用程序就不得不恢复回来。如何以编程方式为iPhone执行此操作?如何从我的应用程序拨打电话,而不必在iPhone中退出我的应用程序?
谢谢。
看到这个主题,你可以从那里的代码片段如用它 making a phone call w/o quitting an appication
请记住,它可能只能从iOS版3.1。如果您的目标是iOS 3.0,则无法退出应用程序。
NSString *callString = [NSString stringWithFormat:@"tel:%@", @"412-33-44-55"];
NSURL *url= [NSURL URLWithString:callString];
NSString *osVersion = [[UIDevice currentDevice] systemVersion];
if ([osVersion compare: @"3.1" options: NSNumericSearch] >= NSOrderedSame) {
UIWebView *webview = [[UIWebView alloc] initWithFrame:[callButton frame]];
webview.alpha = 0.0;
[webview loadRequest:[NSURLRequest requestWithURL:url]];
// Assume we are in a view controller and have access to self.view
[self.view insertSubview:webview belowSubview:callButton];
[webview release];
}
else {
// On 3.0 and below, dial as usual
NSString * s = [NSString stringWithFormat:@"tel://%@",@"412-33-44-55"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:s]];
}
哎,wher是该链接指向??后登录它去iPhone开发者,让我们开始讨论页面:( – VinuthnaS 2010-08-26 09:39:18
你需要打开这个线程之前,你的开发人员凭据登录。该片段是在一个最后一条消息我可以在输入我的iPhone开发凭证后到达线程让我知道如果你不能得到它我会在这里复制/粘贴它,但是你不能用模拟器尝试它,只能安装3.1或更高版本的设备 – 2010-08-26 11:37:30
嗨Nava Carmon,我已经进入了我的凭据,它的接受ñ再次指导我到同一页..你可以请复制/粘贴在这里... – VinuthnaS 2010-08-26 11:48:13