在 iPhone 中以编程方式发送短信
如何以编程方式向 iPhone 联系人列表中选择的特定号码发送短信?
How can you send an SMS programmatically to a particular number selected in the contact list in iPhone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MFMessageComposeController
就是您正在寻找的。要发送短信,您会看到类似这样的内容:
这是目前从您的应用程序发送短信的唯一方法。除非您只想打开短信应用程序。如果您不担心消息正文,可以执行以下操作:
MFMessageComposeController
is what you're looking for.To send an SMS, you're looking at something like this:
That's the only way to send SMSs from your app at the moment. Unless you just want to open the SMS app. If you aren't worried about the body of the message, you can do this:
呃...我认为在这里进行一些讨论会有所帮助。
我(可能错误地)认为“...以编程方式发送短信...”的意思是在幕后发送短信,然后 MFMessageComposeViewController 弹出。
如果这就是问题所在,则上述答案的绿色复选标记是不正确的。我将假设这就是问题所在(我敢打赌我不是唯一的问题)并提供一些子弹以节省其他人我花在此处的时间。
Uh... I think a little discussion would be helpful here.
I (maybe mistakenly) take the question, "... send an SMS programmatically ..." to mean sending SMS behind the scenes, w o the MFMessageComposeViewController popping up.
The green checkmark for the answer above is incorrect IF that's the question. I am going to assume that that is the question (I bet I'm not the only one) and offer some bullets to save others the time I have spent getting here.