[ 
https://issues.apache.org/jira/browse/CB-5488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13966465#comment-13966465
 ] 

Garth Gutenberg edited comment on CB-5488 at 4/11/14 1:03 PM:
--------------------------------------------------------------

New patch:

{code:JavaScript}
document.addEventListener( 'deviceready', function() {
        window.hasFiredDeviceReady = true;
}, false );

var devicereadyTimeout = parseInt( window.localStorage.getItem( 
'devicereadyTimeout' ) ) || 1000;
setTimeout( function() {
        // Fix for deviceready not firing
        // https://issues.apache.org/jira/browse/CB-5488
        console.log( 'Checking window.hasFiredDeviceReady' );
        if ( ! window.hasFiredDeviceReady ) {
                window.localStorage.setItem( 'devicereadyTimeout', 
devicereadyTimeout + 1000 );
                window.location.reload();
        }
        else {
                alert( devicereadyTimeout );
        }
}, devicereadyTimeout );
{code}

In the case of an iPhone 4 running iOS 7.1, devicereadyTimeout reached 21000 
before deviceready fired.  

Is anyone from Cordova listening to this?  Bueller?  Bueller?  Bueller?


was (Author: ggutenberg):
New patch:

{code:JavaScript}
document.addEventListener( 'deviceready', function() {
        window.hasFiredDeviceReady = true;
        if ( parseFloat( window.device.version ) >= 7.0 && 
window.device.platform == 'iOS' ) {
                document.body.style.marginTop = '20px';
        }
}, false );

var devicereadyTimeout = parseInt( window.localStorage.getItem( 
'devicereadyTimeout' ) ) || 1000;
setTimeout( function() {
        // Fix for deviceready not firing
        // https://issues.apache.org/jira/browse/CB-5488
        console.log( 'Checking window.hasFiredDeviceReady' );
        if ( ! window.hasFiredDeviceReady ) {
                window.localStorage.setItem( 'devicereadyTimeout', 
devicereadyTimeout + 1000 );
                window.location.reload();
        }
        else {
                alert( devicereadyTimeout );
        }
}, devicereadyTimeout );
{code}

In the case of an iPhone 4 running iOS 7.1, devicereadyTimeout reached 21000 
before deviceready fired.  

Is anyone from Cordova listening to this?  Bueller?  Bueller?  Bueller?

> deviceready event not firing with jQuery Mobile
> -----------------------------------------------
>
>                 Key: CB-5488
>                 URL: https://issues.apache.org/jira/browse/CB-5488
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 3.1.0
>            Reporter: Federico Kereki
>            Assignee: Shazron Abdullah
>
> If you use PhoneGap + jQuery + jQuery Mobile, the deviceready event doesn't 
> fire. Googling around, I found several similar reports, all pointing out that 
> if jQuery Mobile isn't included, the event fires.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to