send sms through programming in iPhone? [duplicate

2019-05-24 21:32发布

Possible Duplicate:
How to programmatically send SMS on the iPhone?

is it possible to send sms through programming in iPhone/iPod applications.

标签: iphone sms
3条回答
够拽才男人
2楼-- · 2019-05-24 21:51

There are two answers to this question: 1 - Not really. 2 - Of course!

Using OS3.x, you can sorta kinda almost do it. You can programmatically bring the user to the built-in SMS drafting application and you can pre-populate the "TO:" field. However, you cannot programmatically generate the message to be sent.

Using OS4.0 (currently in Beta) you can (according to these guys http://iphonesdkdev.blogspot.com/2010/04/mfmessagecomposeviewcontroller-sample.html) present a modal view of the SMS drafting application, or, rather you can show the user something that looks and behaves like the built-in SMS application without actually taking them out of your program (google MFMessageComposeViewController) and populate all of the fields... you can even provide more than one destination address for the SMS/MMS message.

That being said, there is no way of sending SMS messages without first presenting those messages to the user. At which point the user is free to either send them, not send them, or modify them before sending them.

查看更多
混吃等死
3楼-- · 2019-05-24 21:53

You can set the body in iOS 4. Please cf the documentation.

查看更多
放荡不羁爱自由
4楼-- · 2019-05-24 21:55

It is possible to initiate a sms message using the sms:<phone-no> URL. It is however not possible to fill in any content in the sms, nor is it possible to automatically send the sms.

More details are available in this Apple article.

查看更多
登录 后发表回答