inAppBrowser插件不能与Phonegap 3.3.0和iOS一起使用

时间:2014-07-04 11:08:20

标签: cordova phonegap-build

我正在使用Phonegap Build(使用Phonegap版本3.3.0),并且我在config.xml文件中声明了inAppBrowser插件:

<gap:plugin name="org.apache.cordova.inappbrowser" />

然后我试图打开一个这样的窗口:

var clientId = "1039432660734-psg3tpmi0k39csh581c2p8vnqbnkuoq9.apps.googleusercontent.com"; //localhost
var urlAuth = "https://accounts.google.com/o/oauth2/auth?"
        + "scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&"
        + "redirect_uri=http://localhost&"
        + "response_type=code&"
        + "client_id=" + clientId;
authWindow = window.open(urlAuth, '_blank', 'location=yes,toolbar=no');     
authWindow.addEventListener('loadstart', parseRedirectUrl);

它适用于Android,但不适用于iOS ...我没有看到浏览器进来,没有任何反应....

你能帮帮忙吗?

1 个答案:

答案 0 :(得分:0)

验证插件的源文件(CDVInAppBrowser.m)是否已添加到&#34;编译源&#34;部分。您的XCode项目目标,在选项卡&#34; Build Phases&#34;

最近我安装了插件PushPlugin

cordova中存在标记为已解决的问题,但仍有一些错误:https://issues.apache.org/jira/browse/CB-4971

- 已编辑 -

如果这是您的错误,您应该在XCode的输出窗口中看到类似的内容:

2014-07-04 12:20:20.057 MyApp[2461:70b] ERROR: Plugin 'InAppBrowser' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-07-04 12:20:20.057 MyApp[2461:70b] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
  "InAppBrowser1265448945",
  "InAppBrowser",
  "open",
  [
    "http:\/\/www.google.com\/",
    "_system",
    null
  ]