至mailto:链接不是在科尔多瓦的应用程序在Android上打开邮件应用程序 [英] mailto: links not opening mail app on Android in cordova app
问题描述
这是推动我疯了。我工作的一个应用程序离子(科尔多瓦,角等)。我有一个联系我们友情链接,其中包含一个mailto:HREF
This is driving me crazy. I'm working on a Ionic app (Cordova, Angular etc). I have a contact us link which contains a mailto: href
href="mailto:info@somedomain.net?subject=my%20App"
我就这样说,你必须删除阅读了无数的帖子
I've read countless posts on SO that say you have to remove
<access origin="*"/>
从项目根config.xml和其替换为:
from the config.xml in the project root and replace it with:
<access origin="mailto:*" launch-external="true" />
我已经完成。当我运行离子生成
将其添加到config.xml中平台/安卓/ RES / XML
。但无论我做什么的链接不打开任何Android模拟器(甚至在电子邮件中的模拟器配置)的邮件应用。
Which I've done. When I run ionic build
it gets added to the config.xml in platforms/android/res/xml
. But no matter what I do the link doesn't open the mail app on any Android simulator (even when email is configured in the simulator).
不幸的是我没有一个装置来测试 - 因此这只是一个模拟器的事还是我失去了一些东西。
Sadly I don't have a device to test on - so is this just a emulator thing or am I missing something?
推荐答案
您必须安装科尔多瓦插件白名单
cordova plugin add cordova-plugin-whitelist
或者,如果你想引用保存到您的 config.xml中文件:
cordova plugin add cordova-plugin-whitelist --save
和你有意向添加到您的 config.xml中文件:
and that you have to add the intent to your config.xml file:
<allow-intent href="mailto:*" />
您可以在这里找到更多信息。
You can find more info here.
这篇关于至mailto:链接不是在科尔多瓦的应用程序在Android上打开邮件应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!