iOS Development-Call Summary

Source: Internet
Author: User

As for the iOS app, there are 3 ways that I know about making calls:


One. Using OpenURL (tel)

Features: direct dial, not pop-up hint. And, after the call, stay in the address Book, do not return to the original app.

Call-(void) Callphone: (NSString *) phonenumber{    //phonenumber = "18369 ..."    Nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@ "tel:%@", PhoneNumber];    [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:str];}

Two. Using Requestwithurl (recommended)

Features: Pop-up prompt before dialing. And, you will return to the original application when you finish dialing.

Call-(void) Callphone: (NSString *) phonenumber{    //phonenumber = "18369 ..."    Nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@ "tel:%@", PhoneNumber];    UIWebView * Callwebview = [[UIWebView alloc] init];    [Callwebview loadrequest:[nsurlrequest Requestwithurl:[nsurl Urlwithstring:str]];    [Self.view Addsubview:callwebview];}

Three. Using OpenURL (telprompt)

Features: Pop-up prompt before dialing. And, you will return to the original application when you finish dialing.

Note: There has been no telprompt in Apple's official documentation, which was previously used and rejected when uploading the audit.

Call-(void) Callphone: (NSString *) phonenumber{    //phonenumber = "18369 ..."    Nsmutablestring * str=[[nsmutablestring alloc] initwithformat:@ "telprompt://%@", PhoneNumber];    [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:str];}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.