简体   繁体   English

iPhone SDK中的短信正文

[英]SMS body in iphone SDK

I need to send an SMS from my iphone app. 我需要从iPhone应用程序发送短信。 the body of the SMS is created programatically. SMS的正文是通过编程创建的。 so when i tap on a button the SMS application should get opened with my message pre-typed in it. 因此,当我点击一个按钮时,SMS应用程序应该会打开,并在其中预先输入我的消息。 anybody knows how to do it? 有人知道怎么做吗? need help 需要帮忙

Thanks in advance. 提前致谢。 Shibin 世斌

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: 根据官方SDK,您只能从代码中执行以下操作:1)打开SMS应用程序:

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

and 2) to set the phone number for a new message: 和2)设置新消息的电话号码:

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

您可以在iOS 4中设置主体。请参阅文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM