Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

send link in text message in iPhone

Tags:

ios

sms

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];
    }
}
like image 785
Sandroid Avatar asked May 11 '12 09:05

Sandroid


People also ask

How do I send a link in a text message?

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.

Can you hyperlink on iPhone messages?

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).


1 Answers

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.

like image 69
rckoenes Avatar answered Oct 08 '22 13:10

rckoenes