[iOS-GQiang]iOS app内发送短信
2014-11-15 09:38
369 查看
- (IBAction)actionButton:(id)sender { if( [MFMessageComposeViewController canSendText] ){ MFMessageComposeViewController * controller = [[MFMessageComposeViewController alloc]init]; //autorelease]; controller.recipients = [NSArray arrayWithObject:@"10010"]; controller.body = @"测试发短信"; controller.messageComposeDelegate = self; [self presentViewController:controller animated:YES completion:^{ }]; [[[[controller viewControllers] lastObject] navigationItem] setTitle:@"测试短信"];//修改短信界面标题 }else{ [self alertWithTitle:@"提示信息" msg:@"设备没有短信功能"]; } } - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result{ [controller dismissViewControllerAnimated:NO completion:^{ }];//关键的一句 不能为YES switch ( result ) { case MessageComposeResultCancelled: [self alertWithTitle:@"提示信息" msg:@"发送取消"]; break; case MessageComposeResultFailed:// send failed [self alertWithTitle:@"提示信息" msg:@"发送成功"]; break; case MessageComposeResultSent: [self alertWithTitle:@"提示信息" msg:@"发送失败"]; break; default: break; } } - (void) alertWithTitle:(NSString *)title msg:(NSString *)msg { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil]; [alert show]; }
相关文章推荐
- ios app内发送短信
- iOS APP调取短信 发送消息给其他人
- iOS App内发送短信
- IOS 在App中发送SMS短信
- ios-->短信发送
- iOS发送短信代码
- <ios>调用系统的短信和发送邮件功能,实现短信分享邮件分享
- 不要相信短信:iOS漏洞允许用户发送虚假短信
- IOS 发送短信实现
- iOS 中获得本机号,拨打电话,发送短信
- iOS发送短信
- ios 调用短信接口发送指定内容的消息
- 短信发送流程二:自定义APP短信发送流程(2.3)
- 在iOS开发中,经常需要调用其它App,如拨打电话、发送邮件等。UIApplication:openURL:方法是实现这一目的的
- iOS 调用系统短信、邮件发送界面
- iOS发送短信
- iOS-调用系统的短信和发送邮件功能,实现短信分享邮件分享
- ios 发送邮件和短信
- ios 调用短信接口发送指定内容的消息
- iOS ---在app里面嵌入发送邮件功能