如何在Objective-C中以编程方式发送带有一些正文文本的短信 [英] How to send SMS with Some Body text programmatically in Objective-C

查看:82
本文介绍了如何在Objective-C中以编程方式发送带有一些正文文本的短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
如何在 iPhone 上以编程方式发送短信?

如何使用 Objective-C 从 iPhone 以编程方式发送带有一些正文文本的短信.正在尝试执行以下操作:

How to Send SMS with Some Body text programmatically from iPhone using Objective-C. Was trying to do something like:

NSString *path = [NSString stringWithFormat:@"sms:?&body:%@", aSMSBodyText];
NSURL *url = [NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] canOpenURL:url];

但不工作,我不想使用 MFMessageComposeViewController,因为我的应用程序从 3.0 开始支持 &MFMessageComposeViewController 从 4.0 开始适用.

but not working, I don't want to use MFMessageComposeViewController, cause my app supports from 3.0 Onwards & MFMessageComposeViewController is applicable from 4.0 Onwards.

推荐答案

如果不使用 MFMessageComposeViewController,您将无法发送 SMS.如果你想发送短信,那么你必须使用 MFMessageComposeViewController.否则,您可以使用服务器使用短信.首先,您需要向服务器发送消息,然后服务器将向任意号码发送消息.您也可以使用短信网关发送短信.

You can not send SMS without the use of MFMessageComposeViewController. if you want to send SMS, then you have to use MFMessageComposeViewController. Otherwise, you can use server to use SMS. First you need to send message to server and then server will send message to any number. You can also use SMS gateway for sending SMS.

这篇关于如何在Objective-C中以编程方式发送带有一些正文文本的短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆