The implementation of dialing and calling in iOS development

Source: Internet
Author: User

The first of these methods

Cons: After dialing the method, the phone will not return to the application when it hangs up, it will stay in the call log interface

Nsurl *url = [Nsurl urlwithstring:@ "tel//185------"];

[UIApplication shareapplication] openurl:url];

The second method (Apple private API) Audit will be problematic

when a call is made, the user will be dialed and returned to the application when the phone is hung up.

Nsurl *url = [Nsurl urlwithstring:@ "telprompt://185------"];

[UIApplication shareapplication] openurl:url];

The third is to use WebView to load the URL, after the broadcast can automatically return to the application

Note: This webView must not be added to the interface, or it will block other interfaces

@property (Nonatomic,strong) UIWebView * WebView;

If(_webview! = nil){

_webview = [UIWebView alloc] Initwithframe:cgrectzero];
}

[_webview loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:@ "tel://185------"];

The implementation of dialing and calling in iOS development

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.