Iphone – How to access and open the iPhone’s SMS API from an iPhone app

cocoa-touchios4iphonesms

In my iPhone app, I need to access the SMS application.

I need that when I click a button in my iphone app. It should open the SMS app of iphone and preload the message body with the text that I specify in my app.

How can we access the SMS API from iPhone app?

What should be done?

Best Answer

This is possible starting from iOS 4.0; use the MFMessageComposeViewController from the MessageUI Framework.

Details and example: http://developer.apple.com/library/ios/#samplecode/MessageComposer/Introduction/Intro.html