问题
I am sending out an email using the MFMailComposeViewController.
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"subject"];
[controller
setMessageBody:@"<a href=\"http://website.com\" target=\"_blank\">Link</a>."
isHTML:YES
];
[self presentViewController:controller animated:YES completion:nil];
When the recipient opens this email in the default Mail app and taps the hyperlink, the page opens in Safari. This is the desired behavior. However, if the recipient opens this email in the Gmail app, Gmail presents the page within itself using a UIWebView. This is problematic for me, because somehow Gmail's UIWebView setup has prevented my page's javascript from running (the javascript runs fine when testing with my own UIWebView, however). How would I force Gmail to open my page in Safari instead so my page runs properly?
回答1:
You can't. Instead you should concentrate on making your web page capable of determining what features are available in the browser being used to view it and implement graceful degradation so users get the best possible experience however they choose to view the page.
来源:https://stackoverflow.com/questions/18282547/how-do-you-open-a-link-in-safari-from-the-gmail-app