I have situation where On clicking on app icon i have to send sms and call to a 5 numbers....do we have any third party api's or we have predefined classes in ios?
Asked
Active
Viewed 58 times
-1

Nishanth
- 33
- 8
-
2You can use `MFMessageComposeViewController ` to send a message. But you can only call on number at a time using the `tel:` scheme. – rckoenes Feb 17 '17 at 12:16
2 Answers
1
regarding the second part of your question "predefined classes in ios"
you can open the device caller or messages app using a url:
func sms(to number: String) {
guard let url = URL(string: "sms:" + number) else {
return
}
UIApplication.shared.openURL(url)
}
func call(_ number: String) {
guard let url = URL(string: "tel://" + number) else {
return
}
UIApplication.shared.openURL(url)
}
example:
sms(to: "12345678901")
call("12345678901")

zombie
- 5,069
- 3
- 25
- 54
0
You can send same message to multiple user at same time using MFMessageComposerView. You can use third party api to message like Nexmo and Twilio.
You can do call once a time. Below is code for call:
NSString *phoneNumber = @"YOUR_CALL_NUMBER";
NSString *phoneURLString = [NSString stringWithFormat:@"tel:%@", phoneNumber];
NSURL *phoneURL = [NSURL URLWithString:phoneURLString];
[[UIApplication sharedApplication] openURL:phoneURL];

Nirmalsinh Rathod
- 5,079
- 4
- 26
- 56