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];
}
}
The big question is, how do you send a link over text? There's just one easy step to follow. To include a link in any text message, just type or paste the full URL into your text. Most messaging platforms will automatically turn the URL into a link that allows contacts to click and access the linked page.
Add a link. Tap an object, text box or selected text you want to turn into a link, then tap Link. to see Link. Tap Link To and choose a link type (Web Page, Email, Phone Number, Page or Bookmark).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With