简体   繁体   English

Cordova InAppBrowser无法通过build.phonegap.com工作

[英]Cordova InAppBrowser not working via build.phonegap.com

I am working on an simple Phonegap App with Cordova InAppBrowser. 我正在使用Cordova InAppBrowser开发一个简单的Phonegap应用程序。 I am testing on my Android device. 我正在Android设备上进行测试。

In the config.xml I got the below code 在config.xml中,我得到了以下代码

....
<preference name="phonegap-version" value="cli-5.2.0" />
.....
<plugin name="cordova-plugin-whitelist" source="npm" />
<plugin name="org.apache.cordova.inappbrowser" source="pgb" />
.....
<access origin="*"/>

<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />

<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />

....

In Javascript I got the below code when a button is clicked 在Javascript中,单击按钮后得到以下代码

....
var ref = cordova.InAppBrowser.open('http://google.com', '_blank', 'location=yes','fullscreen=no');
....

index.html index.html

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=medium-dpi" />
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src * 'self' data:">

I use Phonegap Desktop App for testing purposes. 我使用Phonegap Desktop App进行测试。 In that when the button is touched a browser window got opened and I could see the google. 通过触摸按钮,浏览器窗口打开,我可以看到google了。

But when I build the same via http://build.phonegap.com and install on my device. 但是,当我通过http://build.phonegap.com构建相同文件并安装在我的设备上时。 Nothing opens after I touch the button. 触摸按钮后,什么都没有打开。 Something goes wrong here. 这里出问题了。

Looks strange for me. 对我来说看起来很奇怪。 Any help is appreciated. 任何帮助表示赞赏。

I posted the same question on Adobe Forums and got the solution for my problem. 我在Adobe论坛上发布了相同的问题,并为我的问题找到了解决方案。

https://forums.adobe.com/thread/2138992 https://forums.adobe.com/thread/2138992

After changing the below, it started working 更改以下内容后,它开始工作

<plugin name="org.apache.cordova.inappbrowser" source="pgb" />

to

<plugin name="cordova-plugin-inappbrowser" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM