[jira] [Commented] (CB-5753) iOS: CDVLocation locationManager didFailWithError

2014-10-22 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5753:
-

Here's what I do to reliably reproduce the problem (though it's a pain)...

In the iOS Simulator, set the Location to City Run.  Create an app that grabs 
the position via navigator.geolocation.watchPosition().  Give the app *Required 
background modes* : *App registers for location updates* in the plist.  Deploy 
to the simulator, connect the Safari debugger, and background the app.  Within 
8-12 mins, an error will be thrown and the 2 lines that I commented out are 
processed.

There's probably a better way to cause an error, but that worked 100% of the 
time in my testing.  It also happens on physical devices after the app is 
backgrounded for 8-12 mins.

> iOS: CDVLocation locationManager didFailWithError
> -
>
> Key: CB-5753
> URL: https://issues.apache.org/jira/browse/CB-5753
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Geolocation
>Affects Versions: 2.9.0, 2.9.1
> Environment: iOS
>Reporter: Martin Robin
>Assignee: Shazron Abdullah
>  Labels: patch
>
> The delegate handler for didFailWithError appears to have a couple of 
> issues...
> According to the 
> [documentation|https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html#//apple_ref/occ/intfm/CLLocationManagerDelegate/locationManager:didFailWithError:],
>  {quote}If the location service is unable to retrieve a location right away, 
> it reports a kCLErrorLocationUnknown error and keeps trying. In such a 
> situation, you can simply ignore the error and wait for a new event.{quote}
> The handler within CDVLocation does not however take this into account and as 
> a result if this error is raised it causes the location manager to be shut 
> down without any warning.
> Within the same handler, there appears to be code to send a notification back 
> to the JavaScript by way of the onError function. This notification is never 
> received in the JavaScript so the error cannot be handled (by calling 
> clearWatch and then restarting with a call to watchPosition for example).
> The first problem is (I believe) fairly easily resolved; simply ignoring the 
> error (though possibly notifying the JavaScript) would suffice.
> I have no idea how to resolve the second problem. I have tried tracing the 
> code and it appears to call commandDelegate::sendPluginResult (via 
> returnLocationError) but the onError function in the (my) JavaScript does not 
> receive the error. I do not understand how the plug-in model works enough to 
> be able to follow up any further for myself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Comment Edited] (CB-5753) iOS: CDVLocation locationManager didFailWithError

2014-10-17 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg edited comment on CB-5753 at 10/17/14 5:51 PM:
---

I've found that an error always occurs within 8-12 mins of backgrounding an app 
that's receiving location updates.  This is a huge problem for fitness tracker 
apps, as the app simply stops listening to location updates after that error 
occurs.

In order to work around this, I've modified CDVLocation.m, specifically the 
didFailWithError override.  I've removed lines 346 and 347:

{code}
//[self.locationManager stopUpdatingLocation];
//__locationStarted = NO;
{code}

I personally have no idea why this would have been written in a way such that 
location updating would simply stop because an error was thrown.  By removing 
these two lines the app continues functioning properly even if an error occurs. 
 However, as noted in the second part of this issue, the fact that an error 
occurs does not bubble up to the JS layer, so it's impossible to handle it.  
But an invisible error is better than a fatal error, at least in my scenario.


was (Author: ggutenberg):
I've found that an error always occurs within 8-12 mins of backgrounding an app 
that's receiving location updates.  This is a huge problem for fitness tracker 
apps, as the app simply stops listening to location updates after that error 
occurs.

In order to work around this, I've modified CDVLocation.m, specifically the 
didFailWithError override.  I've removed lines 346 and 347:

//[self.locationManager stopUpdatingLocation];
//__locationStarted = NO;

I personally have no idea why this would have been written in a way such that 
location updating would simply stop because an error was thrown.  By removing 
these two lines the app continues functioning properly even if an error occurs. 
 However, as noted in the second part of this issue, the fact that an error 
occurs does not bubble up to the JS layer, so it's impossible to handle it.  
But an invisible error is better than a fatal error, at least in my scenario.

> iOS: CDVLocation locationManager didFailWithError
> -
>
> Key: CB-5753
> URL: https://issues.apache.org/jira/browse/CB-5753
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Geolocation
>Affects Versions: 2.9.0, 2.9.1
> Environment: iOS
>Reporter: Martin Robin
>  Labels: patch
>
> The delegate handler for didFailWithError appears to have a couple of 
> issues...
> According to the 
> [documentation|https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html#//apple_ref/occ/intfm/CLLocationManagerDelegate/locationManager:didFailWithError:],
>  {quote}If the location service is unable to retrieve a location right away, 
> it reports a kCLErrorLocationUnknown error and keeps trying. In such a 
> situation, you can simply ignore the error and wait for a new event.{quote}
> The handler within CDVLocation does not however take this into account and as 
> a result if this error is raised it causes the location manager to be shut 
> down without any warning.
> Within the same handler, there appears to be code to send a notification back 
> to the JavaScript by way of the onError function. This notification is never 
> received in the JavaScript so the error cannot be handled (by calling 
> clearWatch and then restarting with a call to watchPosition for example).
> The first problem is (I believe) fairly easily resolved; simply ignoring the 
> error (though possibly notifying the JavaScript) would suffice.
> I have no idea how to resolve the second problem. I have tried tracing the 
> code and it appears to call commandDelegate::sendPluginResult (via 
> returnLocationError) but the onError function in the (my) JavaScript does not 
> receive the error. I do not understand how the plug-in model works enough to 
> be able to follow up any further for myself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-5753) iOS: CDVLocation locationManager didFailWithError

2014-10-17 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5753:
-

I've found that an error always occurs within 8-12 mins of backgrounding an app 
that's receiving location updates.  This is a huge problem for fitness tracker 
apps, as the app simply stops listening to location updates after that error 
occurs.

In order to work around this, I've modified CDVLocation.m, specifically the 
didFailWithError override.  I've removed lines 346 and 347:

//[self.locationManager stopUpdatingLocation];
//__locationStarted = NO;

I personally have no idea why this would have been written in a way such that 
location updating would simply stop because an error was thrown.  By removing 
these two lines the app continues functioning properly even if an error occurs. 
 However, as noted in the second part of this issue, the fact that an error 
occurs does not bubble up to the JS layer, so it's impossible to handle it.  
But an invisible error is better than a fatal error, at least in my scenario.

> iOS: CDVLocation locationManager didFailWithError
> -
>
> Key: CB-5753
> URL: https://issues.apache.org/jira/browse/CB-5753
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin Geolocation
>Affects Versions: 2.9.0, 2.9.1
> Environment: iOS
>Reporter: Martin Robin
>  Labels: patch
>
> The delegate handler for didFailWithError appears to have a couple of 
> issues...
> According to the 
> [documentation|https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html#//apple_ref/occ/intfm/CLLocationManagerDelegate/locationManager:didFailWithError:],
>  {quote}If the location service is unable to retrieve a location right away, 
> it reports a kCLErrorLocationUnknown error and keeps trying. In such a 
> situation, you can simply ignore the error and wait for a new event.{quote}
> The handler within CDVLocation does not however take this into account and as 
> a result if this error is raised it causes the location manager to be shut 
> down without any warning.
> Within the same handler, there appears to be code to send a notification back 
> to the JavaScript by way of the onError function. This notification is never 
> received in the JavaScript so the error cannot be handled (by calling 
> clearWatch and then restarting with a call to watchPosition for example).
> The first problem is (I believe) fairly easily resolved; simply ignoring the 
> error (though possibly notifying the JavaScript) would suffice.
> I have no idea how to resolve the second problem. I have tried tracing the 
> code and it appears to call commandDelegate::sendPluginResult (via 
> returnLocationError) but the onError function in the (my) JavaScript does not 
> receive the error. I do not understand how the plug-in model works enough to 
> be able to follow up any further for myself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Created] (CB-6882) Plugman doesn't modify config.xml when installing plugins on BlackBerry

2014-06-05 Thread Garth Gutenberg (JIRA)
Garth Gutenberg created CB-6882:
---

 Summary: Plugman doesn't modify config.xml when installing plugins 
on BlackBerry
 Key: CB-6882
 URL: https://issues.apache.org/jira/browse/CB-6882
 Project: Apache Cordova
  Issue Type: Bug
  Components: BlackBerry
Affects Versions: 3.5.0
Reporter: Garth Gutenberg


When using plugman to add a plugin for blackberry10, it doesn't make the 
required modifications to the config.xml.

Ex, running:

{code}cordova plugin add org.apache.cordova.geolocation{code}

Adds the following to the blackberry10 config.xml:

{code}

read_geolocation

{code}

But running:

{code}plugman install --platform blackberry10 --project platforms/blackberry10 
--www platforms/blackberry10/www --plugin org.apache.cordova.geolocation{code}

does not.



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


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-17 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

Unfortunately Victor's suggestion doesn't solve the issue with Sencha Touch.  
I've moved the cordova.js script tag below the the Sencha loader, and {{'null' 
is not an object (evaluating 'document.body.appendChild')}} still occurs.

> 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: CordovaJS, iOS
>Affects Versions: 3.1.0
>Reporter: Federico Kereki
>
> 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)


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-17 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

Emailing an Xcode project zip to you directly, Andrew.  There's some 
proprietary code in there that I'd prefer wasn't publicly available on the 
internet.  You should have it within the hour.

> 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: CordovaJS, iOS
>Affects Versions: 3.1.0
>Reporter: Federico Kereki
>
> 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)


[jira] [Updated] (CB-6436) deviceready not firing on iOS 7.1 with Sencha Touch 2.3.1

2014-04-11 Thread Garth Gutenberg (JIRA)

 [ 
https://issues.apache.org/jira/browse/CB-6436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Garth Gutenberg updated CB-6436:


Description: 
The {{deviceready}} event never fires due to a JS error on iOS 7.1 with Cordova 
3.4.x.  This is the same issue as reported in CB-5488.

The console error/trace is:
{quote}
[Error] TypeError: 'null' is not an object (evaluating 
'document.body.appendChild')
createExecIframe (cordova.js, line 833)
iOSExec (cordova.js, line 1009)
getInfo (device.js, line 74)
(anonymous function) (device.js, line 48)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1195)
f (cordova.js, line 622)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1183)
onScriptLoadingComplete (cordova.js, line 1369)
scriptLoadedCallback (cordova.js, line 1386)
{quote}

The fix that I've applied to cordova.js (from 3.4.1-0.1.0) is to replace lines 
1627-1630.

Old:
{code:JavaScript}
window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
{code}

New:
{code:JavaScript}
var documentBodyIntervalID = window.setInterval( function() {
if ( null == document.body ) {
return;
}

window.clearInterval( documentBodyIntervalID );

window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
}, 100 );
{code}

I'm just checking document.body every 100ms to make sure that it's not null 
before triggering the rest of the Cordova script.  I suspect it may have to do 
with Sencha Touch 2.3.1, but I can't guarantee it.  I can provide an Xcode 
project if needed.

**Update**:  I just realized that my fix is wreaking havoc on some plugins, as 
they load synchronously and expect cordova to be ready as soon as they load, 
which it isn't.  Definitely need help on this one.

  was:
The {{deviceready}} event never fires due to a JS error on iOS 7.1 with Cordova 
3.4.x.  This is the same issue as reported in CB-5488.

The console error/trace is:
{quote}
[Error] TypeError: 'null' is not an object (evaluating 
'document.body.appendChild')
createExecIframe (cordova.js, line 833)
iOSExec (cordova.js, line 1009)
getInfo (device.js, line 74)
(anonymous function) (device.js, line 48)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1195)
f (cordova.js, line 622)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1183)
onScriptLoadingComplete (cordova.js, line 1369)
scriptLoadedCallback (cordova.js, line 1386)
{quote}

The fix that I've applied to cordova.js (from 3.4.1-0.1.0) is to replace lines 
1627-1630.

Old:
{code:JavaScript}
window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
{code}

New:
{code:JavaScript}
var documentBodyIntervalID = window.setInterval( function() {
if ( null == document.body ) {
return;
}

window.clearInterval( documentBodyIntervalID );

window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
}, 100 );
{code}

I'm just checking document.body every 100ms to make sure that it's not null 
before triggering the rest of the Cordova script.  I suspect it may have to do 
with Sencha Touch 2.3.1, but I can't guarantee it.  I can provide an Xcode 
project if needed.


> deviceready not firing on iOS 7.1 with Sencha Touch 2.3.1
> -
>
> Key: CB-6436
> URL: https://issues.apache.org/jira/browse/CB-6436
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: CordovaJS
>Affects Versions: 3.4.0
> Environment: iOS 7.1
> iPhone 4 + Simulator
>Reporter: Garth Gutenberg
>
> The {{deviceready}} event never fires due to a JS error on iOS 7.1 with 
> Cordova 3.4.x.  This is the same issue as reported in CB-5488.
> The console error/trace is:
> {quote}
> [Error] TypeError: 'null' is not an object (evaluating 
> 'document.body.appendChild')
> createExecIframe (cordova.js, line 833)
> iOSExec (cordova.js, line 1009)
> getInfo (device.js, line 74)
> (anonymous function) (device.js, line 48)
> fire (cordova.js, line 750)
> (anonymous function) (cordova.js, line 1195)
> f (cordova.js, line 622)
> fire (cordova.js, line 750)
> (anonymous function) (cordova.js, line 1183)
> onScriptLoadingComplete (cordova.js, line 1369)
> scriptLoadedCallback (cordova.js, line 1386)
> {quote}
> The fix that I've applied to cordova.js (from 3.4.1-0.1.0) is to replace 
> lines 1627-1630.
> Old:
> {code:JavaScript}
> window.cordova = require('cordova');
> // file: src/scripts/bootstrap.js
> require('cordova/init');
> {code}
> New:
> {code:JavaScript}
> var documentBodyIntervalID = window.setInterval( function() {
> if ( null == document.body ) {
> return;
> }
> 
> window.clearInterval( documentBodyIntervalID );
> window.cordova = 

[jira] [Created] (CB-6436) deviceready not firing on iOS 7.1 with Sencha Touch 2.3.1

2014-04-11 Thread Garth Gutenberg (JIRA)
Garth Gutenberg created CB-6436:
---

 Summary: deviceready not firing on iOS 7.1 with Sencha Touch 2.3.1
 Key: CB-6436
 URL: https://issues.apache.org/jira/browse/CB-6436
 Project: Apache Cordova
  Issue Type: Bug
  Components: CordovaJS
Affects Versions: 3.4.0
 Environment: iOS 7.1
iPhone 4 + Simulator
Reporter: Garth Gutenberg


The {{deviceready}} event never fires due to a JS error on iOS 7.1 with Cordova 
3.4.x.  This is the same issue as reported in CB-5488.

The console error/trace is:
{quote}
[Error] TypeError: 'null' is not an object (evaluating 
'document.body.appendChild')
createExecIframe (cordova.js, line 833)
iOSExec (cordova.js, line 1009)
getInfo (device.js, line 74)
(anonymous function) (device.js, line 48)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1195)
f (cordova.js, line 622)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1183)
onScriptLoadingComplete (cordova.js, line 1369)
scriptLoadedCallback (cordova.js, line 1386)
{quote}

The fix that I've applied to cordova.js (from 3.4.1-0.1.0) is to replace lines 
1627-1630.

Old:
{code:JavaScript}
window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
{code}

New:
{code:JavaScript}
var documentBodyIntervalID = window.setInterval( function() {
if ( null == document.body ) {
return;
}

window.clearInterval( documentBodyIntervalID );

window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
}, 100 );
{code}

I'm just checking document.body every 100ms to make sure that it's not null 
before triggering the rest of the Cordova script.  I suspect it may have to do 
with Sencha Touch 2.3.1, but I can't guarantee it.  I can provide an Xcode 
project if needed.



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


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-11 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

Even better fix - this seems to work flawlessly, but requires modifying 
cordova.js:

Replace lines 1627-1630:

Old:
{code:JavaScript}
window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
{code}

New:
{code:JavaScript}
var documentBodyIntervalID = window.setInterval( function() {
if ( null == document.body ) {
return;
}

window.clearInterval( documentBodyIntervalID );

window.cordova = require('cordova');
// file: src/scripts/bootstrap.js

require('cordova/init');
}, 100 );
{code}

> 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)


[jira] [Comment Edited] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-11 Thread Garth Gutenberg (JIRA)

[ 
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)


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-11 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

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)


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-10 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

A workaround that I've implemented (which doesn't make any sense to me, but 
maybe someone on your side can figure out why it's happening):

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

setTimeout( function() {
console.log( 'Checking window.hasFiredDeviceReady' );
if ( ! window.hasFiredDeviceReady ) {
console.log( 'Reloading...' );
window.location.reload();
}
}, 1 );
{code}

I connect Safari as fast as I can, but the first messages I see are:

{quote}
[Log] deviceready has not fired after 5 seconds. (console-via-logger.js, line 
173)
[Log] Channel not fired: onCordovaInfoReady (console-via-logger.js, line 173)
{quote}

After 10s, the page reloads and I get a full console output, including:

{quote}
[Error] TypeError: 'null' is not an object (evaluating 
'document.body.appendChild')
createExecIframe (cordova.js, line 833)
iOSExec (cordova.js, line 1009)
getInfo (device.js, line 74)
(anonymous function) (device.js, line 48)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1195)
f (cordova.js, line 622)
fire (cordova.js, line 750)
(anonymous function) (cordova.js, line 1183)
onScriptLoadingComplete (cordova.js, line 1369)
scriptLoadedCallback (cordova.js, line 1386)

[Log] deviceready has not fired after 5 seconds. (console-via-logger.js, line 
173)
[Log] Channel not fired: onCordovaInfoReady (console-via-logger.js, line 173)
{quote}

After 10s the page reloads again... only this time the error is not thrown, and 
it loads fine.

> 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)


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-04-10 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

Hey guys.  I just updated to Cordova 3.4.1-0.1.0 and I'm still having an issue 
with deviceready not firing, on both the iOS Simulator and a physical device.  
If I connect desktop Safari to the device/simulator, and call 
window.location.reload() in the console, the reloaded page fires the event.  
But the initial load never does.

I can provide an Xcode project in order for you to reproduce the issue.  This 
is becoming pretty major, as 3.4.1 is supposed to fix the iOS arm64 issues, but 
since I can't even deploy an app successfully using 3.4.x I'm in quite a bind 
here.

Please help.

> 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)


[jira] [Comment Edited] (CB-5488) deviceready event not firing with jQuery Mobile

2014-03-18 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg edited comment on CB-5488 at 3/18/14 8:32 PM:
--

Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  The ST code loads after this block.  Following is the script tag load 
order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

Note that moving cordova.js to the top of the list of scripts has no effect, 
other than the error occurring sooner.  I.e., the following throws the same 
error:

{code}

https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >



{code}

FYI, rolling back to Cordova 3.3.1-0.4.2 resolves the issue.


was (Author: ggutenberg):
Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  The ST code loads after this block.  Following is the script tag load 
order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

Note that moving cordova.js to the top of the list of scripts has no effect, 
other than the error occurring sooner.  I.e., the following throws the same 
error:

{code}

https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >



{code}

> 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)


[jira] [Comment Edited] (CB-5488) deviceready event not firing with jQuery Mobile

2014-03-18 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg edited comment on CB-5488 at 3/18/14 8:16 PM:
--

Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  The ST code loads after this block.  Following is the script tag load 
order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

Note that moving cordova.js to the top of the list of scripts has no effect, 
other than the error occurring sooner.  I.e., the following throws the same 
error:

{code}

https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >



{code}


was (Author: ggutenberg):
Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  Following is the script tag load order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

Note that moving cordova.js to the top of the list of scripts has no effect, 
other than the error occurring sooner.  I.e., the following throws the same 
error:

{code}

https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >



{code}

> 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)


[jira] [Comment Edited] (CB-5488) deviceready event not firing with jQuery Mobile

2014-03-18 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg edited comment on CB-5488 at 3/18/14 8:11 PM:
--

Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  Following is the script tag load order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

Note that moving cordova.js to the top of the list of scripts has no effect, 
other than the error occurring sooner.  I.e., the following throws the same 
error:

{code}

https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >



{code}


was (Author: ggutenberg):
Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  Following is the script tag load order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

> 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)


[jira] [Comment Edited] (CB-5488) deviceready event not firing with jQuery Mobile

2014-03-18 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg edited comment on CB-5488 at 3/18/14 8:07 PM:
--

Same issue for me (Cordova 3.4.0-0.1.3).  Using Sencha Touch, not jQuery 
Mobile.  Following is the script tag load order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}


was (Author: ggutenberg):
Same issue for me.  Using Sencha Touch, not jQuery Mobile.  Following is the 
script tag load order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

> 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)


[jira] [Commented] (CB-5488) deviceready event not firing with jQuery Mobile

2014-03-18 Thread Garth Gutenberg (JIRA)

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

Garth Gutenberg commented on CB-5488:
-

Same issue for me.  Using Sencha Touch, not jQuery Mobile.  Following is the 
script tag load order:

{code}
https://maps.googleapis.com/maps/api/js?&sensor=true&v=3&libraries=geometry";
 type="text/javascript" >




{code}

> 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)