iOS应用发送SMS短消息代码

2018-07-20    来源:open-open

容器云强势上线!快速搭建集群,上万Linux镜像随意使用
//Import the MessageUI Framework into your project and 
//#import the header file into the “.h” file of your controller 
//where you want to open the In-App SMS sheet.
-(IBAction) sendInAppSMS:(id) sender
{
    MFMessageComposeViewController *controller =
        [[[MFMessageComposeViewController alloc] init] autorelease];
    if([MFMessageComposeViewController canSendText])
    {
        controller.body = @"Hello from Mugunth";
        controller.recipients = [NSArray arrayWithObjects:
                @"12345678", @"87654321", nil];
        controller.messageComposeDelegate = self;
        [self presentModalViewController:controller animated:YES];
    }
}

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。

上一篇:Android系统中发送短信和彩信的代码

下一篇:iOS常用的几个动画代码