开发者

How to access and open the iPhone's SMS API from an iPhone app

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 th开发者_StackOverflow社区at I specify in my app.

How can we access the SMS API from iPhone app?

What should be done?


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


Try this :

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

pickerSMS.body = @"hello!";

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜