发送短信MFMessageComposeViewController

        if([MFMessageComposeViewController canSendText]) {
            MFMessageComposeViewController * controller = [[MFMessageComposeViewController alloc] init];
            controller.recipients = @[weakSelf.detailModel.Telphone];//收信人
            //            controller.body = body;//短信内容
            controller.messageComposeDelegate = weakSelf;
            [weakSelf presentViewController:controller animated:YES completion:nil];
        } else {
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示信息"
                                                            message:@"该设备不支持短信功能"
                                                           delegate:nil
                                                  cancelButtonTitle:@"确定"
                                                  otherButtonTitles:nil, nil];
            [alert show];
        }
-(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
    [self dismissViewControllerAnimated:YES completion:nil];
}

 

posted @ 2017-01-04 18:20  超神船长  阅读(1255)  评论(0编辑  收藏  举报