I am using MFMessageComposeViewController
for sending sms to number of users. When click the button it is navigating to following screen. How Can I send the sms directly when user clicked on the sms button in iOS swift?
if (MFMessageComposeViewController.canSendText()) {
let controller = MFMessageComposeViewController()
controller.body = "Message Body"
controller.recipients = ["000","111"]
controller.messageComposeDelegate = self
self.present(controller, animated: true,completion: nil)
}
func messageComposeViewController(_ controller: MFMessageComposeViewController,
didFinishWith result: MessageComposeResult)
{
controller.dismiss(animated: true, completion: nil)
}
No, that is not available to directly send the messages with MFMessageComposeViewController
, it will follow the flow. It will present you with the ComposerView where you have to manually press the send button to send the SMS.
To use without composerView, you should try some third party API's which can be helpful.