如何通过Gmail应用程序在Safari中打开链接? [英] How do you open a link in Safari from the Gmail app?

查看:89
本文介绍了如何通过Gmail应用程序在Safari中打开链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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];

当收件人在默认的Mail应用程序中打开此电子邮件并点击超链接时,该页面将在Safari中打开.这是所需的行为.但是,如果收件人在 Gmail中打开此电子邮件,应用,Gmail使用

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?

推荐答案

您不能.相反,您应该专注于使网页能够确定用于查看它的浏览器中可用的功能,并实现适当的降级功能,以便用户无论选择查看该网页,都能获得最佳体验.

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.

这篇关于如何通过Gmail应用程序在Safari中打开链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆