InAppBrowser不与iOS 10.2(8 Xcode的)正常打开

问题描述 投票:2回答:1

我一直在使用的科尔多瓦 - 插件,插件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>

在控制器使用插件

$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');
};

我使用的离子v1.7.14,科尔多瓦:6.2.0和Xcode中8

ios cordova ionic-framework ios10 inappbrowser
1个回答
0
投票

正如CodeGems建议,在评论中,加入gap://readyContent-Security-Policy应该解决的问题。

© www.soinside.com 2019 - 2024. All rights reserved.