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
Here's what the apple says:
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 to share