[Original] comparison of the three call methods for iOS, and the three call methods for ios

Source: Internet
Author: User

[Original] comparison of the three call methods for iOS, and the three call methods for ios

Make a summary and comparison here.

1. Basic use

NSString * str = [[NSMutableString alloc] initWithFormat: @ "tel: // % @", @ "152xxxx4165"]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString: str];

In this way, the original application cannot be returned after the phone is called. It will stay in the address book and be called directly. No prompt is displayed!

After iOS9.0, this method can return to the original application.

2. Recommended

UIWebView * webView = [[UIWebView alloc] init]; NSURL * url = [NSURL URLWithString: @ "tel: // 152 ***** 4165"]; [webView loadRequest: [NSURLRequest requestWithURL: url]; [self. view addSubview: webView];

This method will return to the original program after the phone is called, and a prompt will pop up!

3. It is not recommended to use it.

NSString * str = [[NSMutableString alloc] initWithFormat: @ "telprompt: // % @", @ "152xxxx4165"]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString: str

Note that the difference between this method and method 1 is that the concatenated string is telprompt, not tel.

Note:

May not be able to pass online review

 

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.