Making a call programmatically from iPhone app and returning back to the app after ending the call

后端 未结 6 1020
你的背包
你的背包 2020-12-03 15:25

I am trying to initiate a call from my iphone app,and I did it the following way..

-(IBAction) call:(id)sender
{

    UIAlertView *alert = [[UIAlertView allo         


        
6条回答
  •  天命终不由人
    2020-12-03 16:08

    You can also use webview, this is my code :

    NSURL *url = [NSURL URLWithString:@"tel://123-4567-890"];
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(50, 50, 150, 100)];
    [self.view addSubview:btn];
    UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(50, 50, 150, 100)];
    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:btn];
    [webview release];
    [btn release];
    

提交回复
热议问题