Вопрос

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.

Это было полезно?

Решение 2

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.

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top