开发者

How to send url in SMS?

开发者 https://www.devze.com 2023-04-10 17:19 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号