Reputation: 4440
I am pretty sure the answer to this is no, but I want to be absolutely certain before I tell my boss. What I would like is to make a phone call through an application so that when the call is made, the user is taken to another screen of the application so I can have my own custom background or whatever for the call screen, and then when they have finished pop back to the original screen.
I did a few searches around and I know it was not possible prior to IOS 4, but I just want to check if IOS 5 added this functionality? Or is it still not possible to create something like this.
Thanks in advance!
Upvotes: 2
Views: 2262
Reputation: 8609
It is possible to make phone calls through an application (you'd have to design your own UI because there aren't any iOS UI elements for it). I've seen phone calling apps (just a quick Google search turns up a few).
Your question isn't clear about whether it is an automated call or not, if so: According to the iOS Human Interface Guidelines, your application should not place calls, send messages or e-mails without the users direct consent. You may also want to review the AppStore guidelines to see if your app idea complies. if you app places automated calls or sends automated messages, it will be rejected / removed from the AppStore.
If the call is not automated, you can initiate a call using this code:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:13214567890"]];
This code opens the phone app. There is currently no way to stay in your app for a phone call, and then terminate it within your own app - that is all handled by the phone app. It should also be noted that this code will not work in the iOS Simulator because the simulator has no phone app.
Refer here for the full documentation from Apple. You may also want to check out these other StackOverflow Posts:
Upvotes: 4
Reputation: 1104
Try with this!
let phoneNumber = txtNum.text!;
let called: NSURL = NSURL(string: "tel://\(phoneNumber)")!
let options = [UIApplicationOpenURLOptionUniversalLinksOnly : false]
UIApplication.shared.open(called as URL, options: options, completionHandler: { (success) in
print("Open url : \(success)")
})
Upvotes: 0
Reputation: 2181
No, customization of the phone call screen is not yet supported.
Upvotes: 0