I use MessageUI
framework to send message.
Here is the code to send message:
let messageComposeVC = MFMessageComposeViewController()
messageComposeVC.messageComposeDelegate = self
messageComposeVC.body = self.textView.text
messageComposeVC.recipients = [contact]
self.present(messageComposeVC, animated: false, completion: nil)
then it show a screen like this:
I don't want to show up this screen, I want to send message directly. Is it possible?
It is IMPOSSIBLE . Apple willn't accept your App. Apple will reject your App if you do like that. The alternate Way is you send the Message and particular number to backend and backend trigger the message to the particular Number.
or you can use some Third parties
You can not send SMS programmatically in background, you can use following third party API to send the text message (SMS).
http://www.nexmo.com/ -> we can use International Message also