iOS problem rollup: 2014-12-10 calling Safari and initiating a phone call in a program

Source: Internet
Author: User
Tags call back

nsurl* URL = [[Nsurl alloc] initwithstring:@ "Http://blog.csdn.net/iukey"];


[[UIApplication Sharedapplication]openurl:url];

nsurl* URL = [[Nsurl alloc] initwithstring:@ "tel:110"];
[[UIApplication Sharedapplication]openurl:url];

iOS Call call three ways

The first way of calling
[HTML] View plaincopy

      • (void) makeacall{
        NSString *number = @ "";//read in the phone number
        NSString *num = [[NSString alloc] Initwithforma t:@ "tel://%@", number]; Number is a string if you end the call using this method, you will enter the contact list
        }
        //The second way to call [HTML] view plaincopy
      • (void) makeacall{
        NSString *num = [[NSString alloc] initwithformat:@ "telprompt://%@", number]; And this method to call before the box whether to call and then after the call back to the program online said this method may not be legal audit
        [[UIApplication sharedapplication] Openurl:[nsurl Urlwithstring:num]]; Dial
        }
        //The Third way to call///The following code can add a phone button in the app, load the phone with UIWebView, this is legal, can be on the App Store. [HTML] View plaincopy-(void) makeacall{
        NSString *phonenum = @ "";//Phone number
        Nsurl *phoneurl = [Nsurl urlwithstring:[ns String stringwithformat:@ "tel:%@", Phonenum]];
        if (!phonecallwebview) {
        Phonecallwebview = [[UIWebView alloc] initwithframe:cgrectzero];// This webview is just a background view does not need to add to the page to effect the same as the method two but this method is legal
        }
        [Phonecallwebview loadrequest:[nsurlrequest Requestwithurl:phoneurl]];
        }

iOS Issues Summary: 2014-12-10 calling Safari and initiating a phone call in a program

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.