How to send SMS without launching text app?

I am developing a simple application that needs to send an SMS message from the application itself, rather than launching its own text application.

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

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

      

Thank!

Thomas

+2


source to share


3 answers


The current SDK cannot be executed. 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.



+1


source


If I'm not mistaken, I think that sending text messages via your own app is only available in the iPhone 4.0 SDK.



+2


source


Here's what the apple says:

https://web.archive.org/web/20140604143837/http://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/SystemMessaging_TopicsForIOS/Articles/SendinganSMSMessage.html

Here's a tutorial for another forum.

http://iosdevelopertips.com/core-services/how-to-send-an-sms-progammatically.html

It is still not fully automated. The user has to click the submit button. I haven't worked yet. Tell me if you have any better luck. If you can think of how to configure the application to "hit" the submit button instead of the user, please let me know.

+1


source







All Articles