Cordova - window.open 在 IOS 上不起作用



当我使用时,我无法在IOS上打开我的cordova应用程序中的链接

window.open('http://maps.apple.com/?q='+label, '_system');

但它适用于(但不在浏览器中(:

window.location.href = 'http://maps.apple.com/?q='+label;

在我的config.xml中,我将其列入白名单:

<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />

在我的index.html:

<meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">

我真的不明白这个问题。。

感谢

在我的iOS Cordova应用程序中,window.open((仅在事件与触摸有关而不是与onDeviceReady((或setTimeout((等自动事件有关时才起作用。

在onclick((事件之后执行window.open操作正常。

最新更新