I'm hoping this is a pretty easy question to answer, as I seem to be very close to getting the ChildBrowser plugin working. I'm using Xcode 4.6.2 and Cordova 2.7.0, attempting to create a basic iPhone app that runs the generic ChildBrowser example.
Let me retrace my steps so far:
1) Downloaded the ChildBrowser plugin from here: https://github.com/phonegap/phonegap-plugins/tree/master/iOS/ChildBrowser
2) Copied all the .xib, .h, and .m files to the Plugins folder.
3) Copied the ChildBrowser.js and index.html files to the www folder.
4) Copied the ChildBrowser.bundle to the Frameworks folder.
5) Modified the plugins node in config.xml, so that it includes:
<plugin name="ChildBrowserCommand" value="ChildBrowserCommand" />
6) On running the default ChildBrowser example, I saw a console warning noting that the button code was deprecated. So I changed this line:
<button onclick="cb.showWebPage('http://google.com');">Click to open ChildBrowser!</button>
to this:
<button onclick="cordova.exec(null, null, 'ChildBrowserCommand', 'showWebPage',['http://www.google.com']);">Click to open ChildBrowser!</button>
I'm able to build the app without any issues, and when I test it using the iOS Simulator (iPhone 6.1), it seems to almost work. Clicking the button does trigger ChildBrowser and I can see all the UI elements at the bottom of the screen. But instead of loading up Google's homepage, I just see "Loading..." and a spinner.
When checking the console, this is the info I'm getting:
2013-05-15 06:01:34.934 HelloWorld[23234:c07] View did load
2013-05-15 06:01:34.936 HelloWorld[23234:c07] Opening Url : INVALID
It feels close! But for whatever reason, the URL isn't valid? Not sure if I've missed a step, or if I've done something wrong in the setup process. I can pull up Google just fine using Safari in the simulator, so I know it's not a connection issue.
Any help or insight greatly appreciated. I've tried looking all over for solutions, and haven't found anything yet. Given how close I am with this, it seems like I'm overlooking something really small?
Cheers!
you should use the InAppBrowser plugin that comes standard with phonegap introduced in 2.3.0 example:
var ref = window.open('http://apache.org', '_blank', 'location=yes');
details at phonegap docs here