我正在开发一个应用程序,其中要求在文本消息中发送链接。我正在使用MFMessageComposeViewController
if iPhone 并尝试了 HTML 字符串,但它不起作用。我正在使用代码:
-(IBAction)sendToSMS:(id)sender
{
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
// NSArray *arr=[[NSArray alloc] initWithObjects:phoneNumber,nil];
// [controller setRecipients:[arr objectAtIndex:0]];
NSLog(@"received:- %@",controller.recipients);
controller.messageComposeDelegate = self;
controller.body =@"<html><body><font color=#FFFFFF>Hello,<br><a href=\"http://www.yahoo.com\">click</a>---here to go to Yahoo!</font></body></html>";
if([MFMessageComposeViewController canSendText])
{
[self presentModalViewController:controller animated:YES];
}
}