How to Access and Open iPhone SMS API from iPhone Application

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

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

How can we access the SMS API from the iPhone app?

What to do?

+2


source to share


2 answers


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



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

+3


source


Try the following:



MFMessageComposeViewController *pickerSMS = [[MFMessageComposeViewController alloc] init];
pickerSMS.messageComposeDelegate = self;

pickerSMS.body = @"hello!";

[self presentModalViewController:pickerSMS animated:YES];
[pickerSMS release];

      

+1


source







All Articles