iOS call feature

Source: Internet
Author: User
Tags call back

The first way to call

- (ibaction) FirstCall: (ID) Sender{

nsstring*phone =@ "18749627117";

if(phone !=nil){

        [[ uiapplication sharedapplication" openurl:[ nsurl urlwithstring:[ nsstring stringwithformat: @" tel :%@ " ,phone]"; // Using this method, the contact list is entered after the call is completed

//[[uiapplicationsharedapplication] openurl:[nsurlurlwithstring:[nsstring stringwithformat:@ "telprompt://%@", phone]]];// Use this method before the call will pop-up box, ask whether to call, and then after the phone call back to the main program, Some people say that this method may not be legal, can not pass the audit

}

}

The second way to call

- (ibaction) Secondcall: (ID) Sender{

    nsstring *str = [ nsstring stringwithformat : @ "tel:%@" @ " 18749627117 " ";

    uiwebview *callwebview = [[ uiwebview Alloc " init];

    [callwebview loadrequest:[ nsurlrequest requestwithurl:[ nsurl urlwithstring:str]"];

[self. Viewaddsubview: Callwebview]; // You can also not add to the page

}


iOS call feature

Related Article

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.