How to send SMS with Some Body text programmatically in Objective-C [duplicate]

此生再无相见时 提交于 2019-12-02 09:54:33

问题


Possible Duplicate:
How to programmatically send SMS on the 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];

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.


回答1:


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.



来源:https://stackoverflow.com/questions/10880790/how-to-send-sms-with-some-body-text-programmatically-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!