Reputation: 3433
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.
Upvotes: 0
Views: 3119
Reputation: 9740
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...
Upvotes: 1
Reputation: 1631
-(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
Upvotes: 0
Reputation: 22305
You can prompt the user to send a message with the number to send it to filled out, along with the body of the message, but you cannot send an SMS without the user completing the send.
Upvotes: 5