1

I'm building an app using Xcode 4.5.1, Cordova/Phonegap 2.1 with the ChildBrowser plugin. I have the following jquery to open all external links using ChildBrowser.

$('a[href^="http"]').live('tap', function(e){
    e.preventDefault();
    var url = $(this).attr("href");
    window.plugins.childBrowser.showWebPage(url, { showNavigationBar: true, showLocationBar: true, showAddressBar: true });
});

In the IPhone 6.0 simulator this works exactly as I want. The childbrowser window pops up and the url is loaded. And the tool bar button displays at the bottom of the childbrowser window allowing you to close the childbrowser returning you to the app exactly where you left it.

The problem is when installed on an iphone running iOS 6, the url is loaded in the childbrowser window but there is no chrome around this window. There is no tool bar or "Done" button to close the childbrowser window. So the only way to get back to the app is to shut down the app and restart it. I've searched the web for anyone having this issue and I've found nothing so I'm assuming it's something I'm doing wrong since no one else seems to have had this problem before.

Any help would be greatly appreciated.

gduncan
  • 11
  • 2

2 Answers2

1

From what I just found, this may be a bug in 2.1 ( http://community.phonegap.com/nitobi/topics/ios6_childbrowser_issue_with_phonegap_2_1_0 ), are you able to use 2.2 or 2.3? 2.3 now has childbroswer built in as 'inAppBrowser'

http://docs.phonegap.com/en/2.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser

Dawson Loudon
  • 6,029
  • 2
  • 27
  • 31
  • The issue in the first link of your comment is about problems due to orientation changes. That's not my problem. I really don't want to change versions of cordova just to find out that I still have the issue. – gduncan Jan 09 '13 at 22:35
  • Have you posted this issue @ community.phonegap.com? The dev's are fairly responsive there. – Dawson Loudon Jan 09 '13 at 23:12
  • I have not. Stackoverflow is my go to site for issues so I posted here first. I will give that a try thank you. – gduncan Jan 09 '13 at 23:35
0

After searching the internet for clues and getting no response at all from the folks at community.phonegap.com. I happened across the answer to my problem here.

The problem was the reference to the childbrowser.js file. While the filename itself is all lower case. The reference that I copied from the guide looked like:

<script src="ChildBrowser.js"></script>

By changing the reference to the lower case version

<script src="childbrowser.js"></script>

Everything worked perfectly in the phone and the simulator.

gduncan
  • 11
  • 2