User97693321
User97693321

Reputation: 3346

How to send url in SMS?

I am sending the SMS from iPhone application using the below code, I have to send the url also ,so I want to know what should be url format so that the when receiver(iphone user) of the SMS tap on url, the url should be opened in the browser by itself. The SMS body is coming from server,so I am extracting the SMS body content from server response and passing to SMS sending code.

NSString *smsBody = @"I am sending the google url: www.google.com";//as a sample sms body  

if ([MFMessageComposeViewController canSendText]) {

    MFMessageComposeViewController *smsComposerController = [[[MFMessageComposeViewController alloc] init] autorelease];
    [smsComposerController setBody:smsBody];
    // smsComposerController.recipients = [NSArray arrayWithObjects:@"+19999999999",nil];
    smsComposerController.messageComposeDelegate = self;
    [self presentModalViewController:smsComposerController animated:YES];
}

Upvotes: 2

Views: 7591

Answers (1)

user981597
user981597

Reputation:

You can send url in sms in both the formats 1. http://www.google.com 2. www.google.com

iPhone will detect both the format as a url and on tap of the url link it will open in browser itself.

Upvotes: 4

Related Questions