iOS Send SMS

Source: Internet
Author: User

iphone development, the way to send SMS:
In iphone development, there are two ways to send SMS:
1. URL Scheme, so you can't set SMS content
123 [[UIApplicationsharedApplication] openURL:[NSURLURLWithString:@"sms://10086"]];//打电话可以这样//[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];
2. Mfmessagecomposeviewcontroller, so you can set the content of the SMS
12345678 MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];        if ([MFMessageComposeViewController canSendText])        {            if (![self.friendLabel.text isEqualToString:@"{好友}"])                controller.recipients = [NSArray arrayWithObjects:self.friendLabel.text, nil];                controller.body = self.shareMessageTextView.text;                controller.messageComposeDelegate = self;                [self presentModalViewController:controller animated:YES];        }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.