如何通过短信发送网址?
我使用下面的代码从 iPhone 应用程序发送短信,我还必须发送 url,所以我想知道 url 格式应该是什么,以便当短信的接收者(iphone 用户)点击 url 时,该 url 应该可以在浏览器中自行打开。 短信正文来自服务器,因此我从服务器响应中提取短信正文内容并传递给短信发送代码。
NSString *smsBody = @"I am sending the google url: www.google.com";//as a sample sms body
if ([MFMessageComposeViewController canSendText]) {
MFMessageComposeViewController *smsComposerController = [[[MFMessageComposeViewController alloc] init] autorelease];
[smsComposerController setBody:smsBody];
// smsComposerController.recipients = [NSArray arrayWithObjects:@"+19999999999",nil];
smsComposerController.messageComposeDelegate = self;
[self presentModalViewController:smsComposerController animated:YES];
}
I am sending the SMS from iPhone application using the below code, I have to send the url also ,so I want to know what should be url format so that the when receiver(iphone user) of the SMS tap on url, the url should be opened in the browser by itself.
The SMS body is coming from server,so I am extracting the SMS body content from server response and passing to SMS sending code.
NSString *smsBody = @"I am sending the google url: www.google.com";//as a sample sms body
if ([MFMessageComposeViewController canSendText]) {
MFMessageComposeViewController *smsComposerController = [[[MFMessageComposeViewController alloc] init] autorelease];
[smsComposerController setBody:smsBody];
// smsComposerController.recipients = [NSArray arrayWithObjects:@"+19999999999",nil];
smsComposerController.messageComposeDelegate = self;
[self presentModalViewController:smsComposerController animated:YES];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以以两种格式通过短信发送网址
1.
http://www.google.com
2.
www.google.com
iPhone 会检测 URL 格式,并在点击 URL 链接时在浏览器本身中打开。
You can send url in sms in both the formats
1.
http://www.google.com
2.
www.google.com
iPhone will detect both the format as a url and on tap of the url link it will open in browser itself.