SMS body in iphone SDK

不羁的心 提交于 2019-12-31 04:20:13

问题


I need to send an SMS from my iphone app. the body of the SMS is created programatically. so when i tap on a button the SMS application should get opened with my message pre-typed in it. anybody knows how to do it? need help

Thanks in advance. Shibin


回答1:


You can't set the SMS body. The only things you can do from your code, as per the official SDK, is 1) to open the SMS application:

NSString *stringURL = @"sms:";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];

and 2) to set the phone number for a new message:

NSString *stringURL = @"sms:+12345678901";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];



回答2:


You can set the body in iOS 4. Please cf the documentation.



来源:https://stackoverflow.com/questions/2084212/sms-body-in-iphone-sdk

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