简体   繁体   中英

how can i send sms programmatically in iphone

I need to send sms programmatically.

I found sending programmatically email in google,But did n't found clear info regarding sending sms programmatically.

Can any one pls post some sample code.

Thank u in advance.

您可以提示用户发送一条带有要发送的号码的消息以及消息的正文,但是如果用户未完成发送,则无法发送SMS。

Here is a perfect blog that can be used to send sms through application. SMS sending through application is introduced with iOS4.0 So you can not use MFMessageComposer in the previous versions of iPhone.

iOS 4 will be the minimum requirement.

hAPPY iCODING...

-(void)displaySMSComposerSheet 
{
    MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
    picker.messageComposeDelegate = self;
    NSString *str=@"Your String for SMS"
    picker.body=str;
    [self presentModalViewController:picker animated:YES];
    [picker release];
}

Use this and add framework MessageUI.framework and call this function whenever you want to send message

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM