Ionic 2 InAppBrowser选项不起作用

时间:2017-07-24 00:58:42

标签: ios angular cordova ionic2

inAppBrowser工作,它会打开一个URL,但我希望它在体验中更加无缝。几乎到了它并不觉得你实际上离开了应用程序。每当我尝试传递任何选项时,它似乎都没有。在docs看起来很简单,你只需要用逗号分隔一长串字符串,但它似乎无法正常工作。

我试过了:

  const browser = this.iab.create('http://example.net','_self', "location=no,toolbar=no,closebuttoncaption=home,transitionstyle=fliphorizontal");
甚至:

 const browser = this.iab.create('http://example.net','_self', "location='no',toolbar='no',closebuttoncaption='home',transitionstyle='fliphorizontal'");

这些选项似乎都没有。在iOS上,似乎总是打开一个safari Web视图中的URL,底部是工具栏,顶部是url / location bar ...

其他人遇到此事吗?我应该提到这种行为适用于iOS

1 个答案:

答案 0 :(得分:5)

使用'_blank'代替'_self'作为目标。

将此添加到您的config.xml

<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="*" />