Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap 2.1.0 external host console logging

The project I am working on involves passing control immediately from iOS phonegap to an external host (although using cache manifest, so not entirely external), via document.location.href, then accessing all phonegap's goodies in the (cached) external javascript.

Prior to iOS 6 and phonegap 2.1.0 this was working fine. Since I upgraded, the first thing I noticed is that console logging no longer gets passed to Xcode. I have created a new project using ./create and copied the new cordova-2.1.0.js (also tried with cordova.ios.js) into my javascript folder of the external content. I have then stripped my external index.html to simply

<!DOCTYPE html>
<html>
    <head>
        <script src="js/lib/phonegap/cordova-2.1.0.js"></script>
    </head>
    <body>
        <button type='button' onclick='console.log("huf")'>click</button>       
    </body>
</html>

I have ensured all my paths are correct (a test in the javascript for the existence of cordova passes). Console logging works correctly before passing control to the external host.

No console log is shown in Xcode.

Anyone any ideas?

like image 988
Dave Avatar asked Mar 26 '26 13:03

Dave


1 Answers

I just tried and for me it work. iPad 3 with iOS6 + PhoneGap 2.1.0 XCode 4.5.1

Are you sure the library loaded correctly? IT might be a good idea to add an ondeviceready event listener and put the logging in there. Also add an alert in there too so you know that your event fired.

like image 52
Menno Bieringa Avatar answered Mar 28 '26 03:03

Menno Bieringa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!