iOS中的链接Ionic应用程序不能立即打开

我在我的应用程序的一个视图中有几个链接:

  1. 分享
  2. 添加到日历
  3. 打开一个外部链接

在我用来testing应用程序的iPhone上,只有按下主屏幕button然后返回到应用程序,才会出现共享/日历对话框。 任何人都可以提出什么可能导致这个? 我不确定在哪里看。

外部链接使用window.open(url,“_system”),因为我无法获得常规types链接在模拟器中工作。 我可以切换回普通的HTML链接,但另一个链接可以在iPhone上testing。 使用iOS在手机浏览器中打开链接的build议方法是什么?

代码大致如下。

.controller('WCtrl', function ($scope, $stateParams, $sce) { // ... $scope.doShare = function () { var options = { message: 'Message here', subject: 'Event shared' }; var onSuccess = function (result) { console.log('Share successful.'); }; var onError = function (msg) { console.log('Sharing failed with message: ' + msg); } window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError); }; $scope.doCalAdd = function () { var onSuccess = function (result) { console.log('Add to calendar successful.'); }; var onError = function (msg) { console.log('Add to calendar failed with message: ' + msg); } // ... window.plugins.calendar.createEventInteractively( title, location, notes, starttime, endtime, onSuccess, onError); }; $scope.doTicketsOpen = function () { var url = w.ticketing; window.open(url, '_system'); }; }) 
 <ion-view class="item-text-wrap" view-title="Event Details"> <ion-content class="has-footer"> <!-- ... --> </ion-content> <ion-footer-bar> <div class="button-bar"> <div class="button icon ion-share" ng-click="doShare();">Share</div> <div class="button icon ion-calendar" ng-click="doCalAdd();">Calendar</div> <div class="button icon ion-link" ng-click="doTicketsOpen();">Ticketing</div> </div> </ion-footer-bar> </ion-view> 

我在index.html中有一个Content-Security-Policy元标记,如下所示。

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

您必须在index.html中的Content-Security-Policy元标记的default-src中添加gap:

这是因为在iOS 10上,苹果公司对CSP的要求越来越严格, *并没有涵盖一些东西