How to send an SMS programmatically on iOS? [duplicate]
Is there a way to make the ‘send’ button get pressed automatically (programmatically)?
Absolutely not. Once you present e-mail or SMS composition view controllers, you have no more programmatic control over those interfaces. Apple would consider such a thing a violation of security or privacy. You're out of luck, unfortunately.
From the documentation for MFMessageComposeViewController
:
Important: The message composition interface itself is not customizable and must not be modified by your application. In addition, after presenting the interface, your application is unable to make further changes to the SMS content. The user can edit the content using the interface, but programmatic changes are ignored. Thus, you must set the values of content fields, if desired, before presenting the interface
精彩评论