OGeek|极客世界-中国程序员成长平台

标题: ios - 为什么电话 :* links don't work on ios? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 21:14
标题: ios - 为什么电话 :* links don't work on ios?

我将此添加到 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:

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

当我点击这样的链接时:Call! ios 上没有任何反应(在 android 上运行良好)。

如果我将 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" />

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



Best Answer-推荐答案


只需删除允许导航

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

我不知道为什么,但它有效!

cordova-ios@4+wkwebview 会先让导航过滤器响应url,然后什么都不做!!

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

关于ios - 为什么电话 :* links don't work on ios?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38310197/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4