0

Can any expert here please point me to some valid walkthrough on how to make the ChildBrowser work with Cordova 1.7 in iPhone? I have found lots of documents and blogs out there that tell you how to do it, but none of them have worked for me. It is not a whitelist issue for sure, as for the time being I have set it to the wildcard *, so whitelisting problems can be safely ruled out I guess. In some cases, ChildBrowser was successfully installed, but when I called the showwebpage function, it just would not show up (there wouldn't be any errors either!). Other times, it just won't even install. I have already spent 2 days on it, and am still clueless. Just hoping if you could help me out. Any help would be appreciated.


I could finally get the ChildBrowser to open up following what Dhawal has suggested below. But the onLocationChange event never seems to fire. Again, this seems to be a common problem with Cordova 1.7. Any workarounds apart from rolling back to some older Cordova version? Any help would be appreciated.

Here's what I am trying to do:

window.plugins.childBrowser.showWebPage(url, { showLocationBar: true });
window.plugins.childBrowser.onLocationChange = function(loc){ alert("In index.html new loc = " + loc); };

Ok, got it to work. Seems like ChildBrowser is still compatible with older versions of Cordova only. Had to delve into Objective-C and make changes in the plugin to make it work.

4

1 回答 1

3

我有一个与 Cordova 1.7 集成子浏览器的基本应用程序。我已经将步骤也用于生成构建相同的应用程序。

ios-cordova-childbrowser

编辑

Childbrowser 事件没有被正确调用,所以我在 ChildBrowser.js 文件中添加了这个修复来解决它。

if (cordovaRef && cordovaRef.addConstructor) {
    cordovaRef.addConstructor(ChildBrowser.install);

    // Make ChildBrowser global
    window.ChildBrowser = ChildBrowser;
 } else {
    console.log("ChildBrowser Cordova Plugin could not be installed.");
    return null;
 }
于 2012-06-14T15:18:27.220 回答