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;
开发者_C百科 [self presentModalViewController:smsComposerController animated:YES];
}
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.
精彩评论