I am developing an app in which the requirement is to send a link in text message.I am using MFMessageComposeViewController if iPhone and tried 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];
}
}
SMS does not support HTML or URLs, just plain text.
All you can do is just add the URL to message and then it’s up to the Message app to recognize the URL and allow the user to click on it.