升级到cordova 3.6.3后,“tel"、“sms"和“mailto"在Android中不再有效 [英] “tel”, “sms”, and “mailto” no longer working in Android after upgrading to cordova 3.6.3

查看:17
本文介绍了升级到cordova 3.6.3后,“tel"、“sms"和“mailto"在Android中不再有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将基于 Cordova 的 Android 应用从 3.5.0 升级到了 3.6.3.特殊链接tel"、sms"和mailto"停止工作.单击时,没有任何反应.我可以在 AndroidManifest.xml、Confix.xml 或其他任何东西中做些什么来让它们恢复工作?

I recently upgraded my cordova based Android app from 3.5.0 to 3.6.3. The special links "tel", "sms", and "mailto" stopped working. When clicked, nothing happens. Is there anything I can do in the AndroidManifest.xml, or Confix.xml or anything else to get them back working?

我构建了两个相同且非常简单的 Android 应用程序来证明我的怀疑,一个使用cordova 3.5.0,一个使用3.6.3.他们都有一个简单的链接:

I built two identical and very simple android apps to prove my suspicion, one with cordova 3.5.0 and one with 3.6.3. Both of them have a simple link:

<a href="tel:1(858)xxx-xxxx">Call</a>

第一个有效,第二个无效.

The first one works, the second one doesn't work.

我认为他们添加了一项以某种方式阻止意图的安全功能.

I think they added a security feature that blocks intents somehow.

PS:两个应用都是这样构建的:

PS: both apps built like this:

cordova create app com.tmp.app "App"
cordova platform add android

在 index.html 中,我在设备就绪块上添加了上面的电话链接.

and in index.html, I added the telephone link above on the device ready block.

请帮忙.

推荐答案

我终于找到了答案.您所要做的就是在 config.xml 中添加以下内容:

I finally found the answer. All you have to do is add the following to config.xml:

<access origin="tel:*" launch-external="yes"/>
<access origin="geo:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
<access origin="sms:*" launch-external="yes"/>
<access origin="market:*" launch-external="yes"/>

希望对大家有所帮助.

这一切都是由 IBM 开始的!!!

It all started by IBM!!!

IBM Cordova 安全问题

这篇关于升级到cordova 3.6.3后,“tel"、“sms"和“mailto"在Android中不再有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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