cordova-plugin-inappbrowser无法打开从APP到IOS设备默认浏览器的链接 [英] cordova-plugin-inappbrowser not opening links from APP to IOS Device default Browser
问题描述
搜索很多,但无法找到正确的解决方案。
Search a lot, but not able to find the correct solution.
I am trying to open links from my app to default browser of my IOS device,
但它不起作用。它与我的Android设备完美配合。
but its not working. Its perfectly working with my android device.
-
我的插件安装正确,(我可以在我的应用程序的cordova插件列表中看到)
My plugin is installed properly, ( i can see that in cordova plugin list on my app)
后面是我尝试过的语法:
followed are the syntaxes, which i have tried:
window.open(this.href,'_ system`);
window.open(this.href, '_system');
window.open(this.href,'_ blank',{closebuttoncaption:'Close',toolbar:'yes','location = yes'});
window.open(this.href, '_blank', {closebuttoncaption: 'Close', toolbar: 'yes', 'location=yes'});
window.open(this.href,'_ blank',{closebuttoncaption:'关闭',工具栏:'是'});
window.open(this.href, '_blank', {closebuttoncaption: 'Close', toolbar: 'yes'});
window.open(this.href,'_ system`,'location = yes')
window.open(this.href, '_system', 'location=yes')
与cordova.InAppBrowser.open相同的解决方案,这个作为起始语法。
same solution with cordova.InAppBrowser.open, this as starting syntax.
以及尝试使用控制器功能
along with that tried with controller function also
link
$ scope.openInExternalBrowser = function(path){
$scope.openInExternalBrowser = function (path) {
var options =closebuttoncaption = Close,toolbar = yes;
if($ ionicPlatform.is('ios')== true){
var options = "closebuttoncaption=Close,toolbar=yes"; if($ionicPlatform.is('ios') == true){
window.open(path, '_blank', {'closebuttoncaption': 'Close', 'toolbar':'yes', 'location=yes'});
}其他{
window.open(路径,'_system','location = yes );
}
}
}else{ window.open(path, '_system', 'location=yes'); } }
所以寻找一些合适的解决方案,这将有效。
So looking for some proper solution, which will work.
谢谢&问候,
Sopo
推荐答案
最后,经过大量的研究和这篇帖子帮助我解决了这个问题。
Finally, after lot of research and thousand of builds, this post helped me to solve the issue.
在cordova-plugin-whitelist插件的帮助下。
你需要在default-src属性之后添加gap:,你的CSP元。
=> default-src gap:*;
with the help of "cordova-plugin-whitelist" plugin. You need to add "gap:" after default-src attribute, your CSP meta. => default-src gap: *;
谢谢StackOverflow。
Thanks StackOverflow.
这篇关于cordova-plugin-inappbrowser无法打开从APP到IOS设备默认浏览器的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!