iOS开发之发送短信
来源:互联网 发布:排名优化软件 编辑:程序博客网 时间:2024/05/23 00:08
@前面配置和邮件发送一样
// 调用系统API发送短信- (void)didClickSendMessageButtonAction{ if ([MFMessageComposeViewController canSendText] == YES) { MFMessageComposeViewController *messageVC = [[MFMessageComposeViewController alloc] init]; // 设置代理<MFMessageComposeViewControllerDelegate> messageVC.messageComposeDelegate = self; // 发送To Who messageVC.recipients = @[@"18757289870"]; messageVC.body = @"hello world"; [self presentViewController:messageVC animated:YES completion:nil]; }else{ NSLog(@"此设备不支持"); }}- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result{ switch (result) { case MessageComposeResultCancelled: NSLog(@"取消发送"); break; case MessageComposeResultFailed: NSLog(@"发送失败"); break; case MessageComposeResultSent: NSLog(@"发送成功"); break; default: break; } [self dismissViewControllerAnimated:YES completion:nil];}// 调用系统应用程序发送消息- (void)didClickSendMessage2ButtonAction{ NSURL *url = [NSURL URLWithString:@"sms:18656348970"]; if ([[UIApplication sharedApplication] canOpenURL:url] == YES) { [[UIApplication sharedApplication] openURL:url]; }else{ NSLog(@"失败"); }}
0 0
- iOS开发之发送短信
- IOS开发 短信发送
- IOS越狱开发之短信--发送内容修改
- iOS开发之打电话,发短信,发送邮件
- Android开发之短信发送
- Android开发之发送短信
- iOS开发之调用系统发短信接口发送指定短信
- ios开发:获取手机通讯录、发送短信
- iOS开发-发送邮件及短信
- iOS开发 MFMessageComposeViewController(发送短信)的使用
- IOS程序之发送短信代码实现
- [iOS]iOS发送短信
- Android开发之发送短信程序
- android开发之发送短信SMS
- Android开发入门之发送短信
- Android开发案例之短信发送器
- Android开发之接收和发送短信
- iOS发送短信
- is too old (format 29) to work with client version '1.8.9 (r1591380)' (expects format 31).
- Git历险记(五)
- ehcache缓存同步配置
- C++小知识:C++类中成员的访问控制属性有哪些类型,什么区别
- 黑马程序员-day22-GUI
- iOS开发之发送短信
- CF(D. Fibonacci Sums)dp计数
- Android configChanges用法
- QuickSort
- Java链接SqlServer
- Mysql基础篇之SQL语句
- 可变阴影矩形--(make thing move)DropShadowFilter
- 深刻认识OpenStack
- 【微软实训】Async / Await 初接触