I am developing an application in which you need to send a link in a text message. I use MFMessageComposeViewControllerif iPhone has tried the HTML string, but it doesn’t work. I am using the code:
-(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];
}
}
source
share