Starting Phone Calls From iPhone App

To start phone call from iPhone app, create url with phone link and open that url via ..sharedApplication] openURL: ... method.


    NSURL *phoneUrl = [NSURL URLWithString:@"tel:1-408-555-5555"];
    
    if ([[UIApplication sharedApplication] canOpenURL:phoneUrl])
        [[UIApplication sharedApplication] openURL:phoneUrl];


Apple document about phone links:
https://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html

No comments:

Post a Comment