ios - navigator.app 未定义

标签 ios xcode cordova

我正在尝试使用:

navigator.app.loadUrl("http://www.google.com", { openExternal:true } );

它不适用于 iOS,无论是在设备上还是在模拟器上。我在一个类似的项目中使用了同一行代码,并且在两个 (1.5.0) 上使用了相同版本的 phonegap。在 android 上,相同的代码可以完美运行。设备就绪功能也会触发,所以我猜正在加载 phonegap。我没有使用 android 的 phonegap.js 文件,我已经检查过了。

在调试时我发现 navigator.app 是一个 undefined object 。有没有人知道我可能缺少导致此问题的配置?

感谢您的帮助。

干杯, 米格尔

最佳答案

“navigator.app”对象仅在 Android 上可用。幸运的是,在即将发布的 PhoneGap 2.3.0 版本中,您将能够:

window.open("http://www.google.com", "_system");

做你想做的事。

关于ios - navigator.app 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13803020/

相关文章:

ios - Parse 和 Facebook 问题 - 无法识别应用程序

swift - 如何使用 Swift 中的 Codable 转换带有可选小数秒的日期字符串?

ios - Xcode Build and Archive for Enterprise Distribution 构建旧存档

cordova - 如何在我的项目中导入cordova插件

XCode 4.2 : Organizer documentation is locked in a OSX Lion way

android - Cordova 构建安卓

ios - Alamofire+组合 : how to get custom error type out of AFError

ios - 在 iOS 中创建水平无限滚动菜单栏

ios - 试图了解 cellForRowAtIndexPath 和 heightForRowAtIndexPath 在处理 UITableViewCells 时如何工作

swift - 如何设置 Xcode Playground 以稳定的方式使用构建的框架?