zoukankan      html  css  js  c++  java
  • iOS发送短信

    iPhone开发,发送短信的方法:
    iPhone开发中,发送短信方法有二:
    1。URL Scheme,这样不可以设置短信内容
    1
    2
    3
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://10086"]];
    //打电话可以这样
    //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];
    2。MFMessageComposeViewController,这样可以设置短信的内容
    1
    2
    3
    4
    5
    6
    7
    8
    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];
            }
  • 相关阅读:
    Oracle 数据库对象
    oracle基础知识
    中文乱码问题
    会话技术Cookie&Session
    HttpServletRequest请求
    JAVA基础之设置随机成语验证码
    HttpServletResponse响应
    Spring注解 AOP@Aspect
    Visual studio Code使用技巧
    缓存相关
  • 原文地址:https://www.cnblogs.com/weiboyuan/p/3852851.html
Copyright © 2011-2022 走看看