iosswiftmessageui

How to send message directly without showing confirm screen?


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:

enter image description here

I don't want to show up this screen, I want to send message directly. Is it possible?


Solution

  • 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).

    1.http://www.twilio.com/

    1. http://www.nexmo.com/ -> we can use International Message also

    2. https://www.tropo.com/