gpt4 book ai didi

ios - InAppBrowser 无法使用 iOS 10.2 (Xcode 8) 正常打开

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:10:34 25 4
gpt4 key购买 nike

我已经使用 cordova-plugin-inappbrowser 插件很长时间了,当我在我的苹果测试设备上将软件更新到 10.2.1 时,插件无法正常工作。当我尝试打开 inappbrowser 链接时,什么都没有发生,除非我单击主页按钮并返回到该应用程序。这种情况发生在模拟器以及真实设备上,如 ipad、iphone 5s、iphone 6 和 iphone 7。它在 android 设备上运行良好,但不是最新的 iOS。

这是我尝试过的所有内容的列表:

  • 已将 inappbrowser 更新到最新版本 - 1.7.1
  • 删除并重新安装插件和 ios 平台
  • 尝试使用 inappbrowser 插件制作一个空白应用
  • 尝试更改 index.html 元标记以包含间隙:

    <meta http-equiv="Content-Security-Policy" content="default-src * &apos;self&apos; gap: ; script-src &apos;self&apos; &apos;unsafe-inline&apos; &apos;unsafe-eval&apos; *; style-src &apos;self&apos; &apos;unsafe-inline&apos; *; child-src &apos;self&apos; &apos;unsafe-inline&apos; *;">

我似乎找不到其他任何东西可以尝试,因为我发现大多数有类似问题的帖子都没有得到解答。

以下是 inappbrowser 插件安装和使用的相关代码:

config.xml结构

<widget>
<content src="index.html"/>
<access origin="*"/>
<allow-navigation href="*"/>
<preference/>
...
<feature name="StatusBar">
...
</feature>
<platform name="ios">
... icons and splash ...
</platform>
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.1"/>
</widget>

在 Controller 中使用插件

$scope.showLink = function(url){
var options = {
location: 'yes'
}
$cordovaInAppBrowser.open(url, '_blank', options)
.then(function(event){
// success
console.log('inappbrowser', event);
})
.catch (function(event) {
// error
console.log('inappbrowser error', event);
});
};

$scope.openUrl = function(url) {
window.open(url, '_blank', 'location=no');
};

我正在使用 ionic v1.7.14、cordova: 6.2.0 和 xcode 8

最佳答案

根据 CodeGems 的建议,在评论中,将 gap://ready 添加到您的 Content-Security-Policy 应该可以解决这个问题。

关于ios - InAppBrowser 无法使用 iOS 10.2 (Xcode 8) 正常打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44025250/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com