Search code examples
xcodeiphone-sdk-3.0sms

How do I send SMS without launching Text application?


I am developing a simple application which has to send an SMS message from the app itself instead of launching the native Text app.

Here's my action now. What should I change to achieve my desired functionality?

-(IBAction)startButtonPressed
{
    NSString *phoneNumber = @"13136296693";
    NSString *url           = [NSString stringWithFormat: @"sms:%@",phoneNumber];
    NSLog(@"Send SMS to: %@ ", url); 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}

Thanks!

Thomas


Solution

  • Can't be done with the current SDK. I believe Apple announced that applications in iPhone OS 4.0 will be able to do this, using a similar interface to the existing MFMailComposeViewController malarkey.