为什么tel:*链接在ios上不起作用? [英] Why tel:* links don't work on ios?

查看:91
本文介绍了为什么tel:*链接在ios上不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将此添加到config.xml

I added this to config.xml

<access origin="*"/>
<access origin="tel:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
<allow-intent href="*"/>
<allow-navigation href="*"/>
<allow-navigation href="tel:*"/>
<allow-navigation href="mailto:*"/>
<allow-navigation href="data:*"/>
<plugin name="cordova-plugin-whitelist" version="1" />

然后将其添加到index.html:

And this to index.html:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">

当我单击这样的链接时:<a href="tel:+1234567">Call!</a>在ios上什么也没有发生(在android上效果很好).

When I'm clicking to a link like that: <a href="tel:+1234567">Call!</a> nothing happens on the ios (on the android it works well).

如果我将config.xml更改为:

If I change my config.xml to:

<access origin="//*"/>
<access origin="tel:*" launch-external="yes"/>
<access origin="mailto:*" launch-external="yes"/>
<allow-intent href="//*"/>
<allow-navigation href="//*"/>
<allow-navigation href="tel:*"/>
<allow-navigation href="mailto:*"/>
<allow-navigation href="data:*"/>
<plugin name="cordova-plugin-whitelist" version="1" />

它调用了,但是对服务器的ajax请求停止工作.

It calls, but ajax requests to server stop working.

推荐答案

只需删除允许导航

<allow-navigation href="tel:*"/>
<allow-navigation href="mailto:*"/>

我不为什么,但是可以!

I don't why ,but it work!

cordova-ios @ 4 + wkwebview将首先获得导航过滤器以响应URL,然后不执行任何操作

cordova-ios@4+wkwebview will get the navigation filter first to respond for the url,and do nothing!!

https://github.com/apache/cordova-plugin -wkwebview-engine/pull/20

这篇关于为什么tel:*链接在ios上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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