对于需要使用插件离子开放外部URL这两个Android和iOS兼容:
科尔多瓦插件添加科尔多瓦 - 插件:
使用下面的管道上安装科尔多瓦 - 插件,inappbrowser -inappbrowser
之后把这个代码在HTML文件中:
<button class="button" ng-click="openurl('https://..........')">
Click here
</button>
然后调用通过控制器单击事件:
.controller('MyCtrl', function($scope, $cordovaInAppBrowser) {
var options = {
location: 'yes',
clearcache: 'yes',
toolbar: 'no'
};
$scope.openurl = function (url) {
window.open(url, '_system', options);
}
OR
$scope.openurl = function (url) {
$cordovaInAppBrowser.open(url, '_system', options);
}
})
在config.xml文件
<allow-intent href="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" launch-external="yes" />
<allow-intent href="https://*/*" launch-external="yes" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
也可以修改进一步参考你可以通过: https://github.com/apache/cordova-plugin-inappbrowser
你有没有试过人行横道? – sam
我只是2-3天的生产不能尝试任何新的东西。 – MobileEvangelist