You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Mr. Extreme (JIRA)" <ji...@apache.org> on 2012/08/28 17:41:09 UTC

[jira] [Created] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Mr. Extreme created CB-1288:
-------------------------------

             Summary: position.timestamp.getTime() fails on iOS, ok on Android
                 Key: CB-1288
                 URL: https://issues.apache.org/jira/browse/CB-1288
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
    Affects Versions: 2.0.0
            Reporter: Mr. Extreme
            Assignee: Shazron Abdullah


Take this piece of code:

{code:javascript}
    gpsWatchId = navigator.geolocation.watchPosition(
                    function( position ) // success
                    {
                        positionTimestamp = position.timestamp.getTime();
                    }
                    // don't forget the rest of the code
{code}

position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah updated CB-1288:
---------------------------------

    Fix Version/s: 2.1.0
    
> position.timestamp.getTime() fails on iOS, ok on Android
> --------------------------------------------------------
>
>                 Key: CB-1288
>                 URL: https://issues.apache.org/jira/browse/CB-1288
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.0.0
>            Reporter: Mr. Extreme
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> Take this piece of code:
> {code:javascript}
>     gpsWatchId = navigator.geolocation.watchPosition(
>                     function( position ) // success
>                     {
>                         positionTimestamp = position.timestamp.getTime();
>                     }
>                     // don't forget the rest of the code
> {code}
> position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Posted by "Mr. Extreme (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445873#comment-13445873 ] 

Mr. Extreme commented on CB-1288:
---------------------------------

I will try to create a small example later and give it a try. Hopefully today. Now I am up to the eyes with work.
                
> position.timestamp.getTime() fails on iOS, ok on Android
> --------------------------------------------------------
>
>                 Key: CB-1288
>                 URL: https://issues.apache.org/jira/browse/CB-1288
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.0.0
>            Reporter: Mr. Extreme
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> Take this piece of code:
> {code:javascript}
>     gpsWatchId = navigator.geolocation.watchPosition(
>                     function( position ) // success
>                     {
>                         positionTimestamp = position.timestamp.getTime();
>                     }
>                     // don't forget the rest of the code
> {code}
> position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah resolved CB-1288.
----------------------------------

    Resolution: Cannot Reproduce

Resolving as no repro. If it can be repro-ed we can re-open for 2.2.0
                
> position.timestamp.getTime() fails on iOS, ok on Android
> --------------------------------------------------------
>
>                 Key: CB-1288
>                 URL: https://issues.apache.org/jira/browse/CB-1288
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.0.0
>            Reporter: Mr. Extreme
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> Take this piece of code:
> {code:javascript}
>     gpsWatchId = navigator.geolocation.watchPosition(
>                     function( position ) // success
>                     {
>                         positionTimestamp = position.timestamp.getTime();
>                     }
>                     // don't forget the rest of the code
> {code}
> position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446217#comment-13446217 ] 

Shazron Abdullah commented on CB-1288:
--------------------------------------

Just run my example when you have the chance - no need to create your own. The example code demonstrates it succinctly.
                
> position.timestamp.getTime() fails on iOS, ok on Android
> --------------------------------------------------------
>
>                 Key: CB-1288
>                 URL: https://issues.apache.org/jira/browse/CB-1288
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.0.0
>            Reporter: Mr. Extreme
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> Take this piece of code:
> {code:javascript}
>     gpsWatchId = navigator.geolocation.watchPosition(
>                     function( position ) // success
>                     {
>                         positionTimestamp = position.timestamp.getTime();
>                     }
>                     // don't forget the rest of the code
> {code}
> position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13445323#comment-13445323 ] 

Shazron Abdullah commented on CB-1288:
--------------------------------------

Tested it using: https://gist.github.com/3541951

So far for me, no repro - position.timestamp is always a Date object. Please test using the test case above and report.
                
> position.timestamp.getTime() fails on iOS, ok on Android
> --------------------------------------------------------
>
>                 Key: CB-1288
>                 URL: https://issues.apache.org/jira/browse/CB-1288
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.0.0
>            Reporter: Mr. Extreme
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> Take this piece of code:
> {code:javascript}
>     gpsWatchId = navigator.geolocation.watchPosition(
>                     function( position ) // success
>                     {
>                         positionTimestamp = position.timestamp.getTime();
>                     }
>                     // don't forget the rest of the code
> {code}
> position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443904#comment-13443904 ] 

Shazron Abdullah commented on CB-1288:
--------------------------------------

The watchPosition js is common on iOS and Android:
https://github.com/apache/incubator-cordova-js/blob/master/lib/common/plugin/geolocation.js#L169

The only differentiating factor would be the native code, and it is setting the timestamp:
https://github.com/apache/incubator-cordova-ios/blob/master/CordovaLib/Classes/CDVLocation.m#L337

I'll try to repro this tomorrow.
                
> position.timestamp.getTime() fails on iOS, ok on Android
> --------------------------------------------------------
>
>                 Key: CB-1288
>                 URL: https://issues.apache.org/jira/browse/CB-1288
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 2.0.0
>            Reporter: Mr. Extreme
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> Take this piece of code:
> {code:javascript}
>     gpsWatchId = navigator.geolocation.watchPosition(
>                     function( position ) // success
>                     {
>                         positionTimestamp = position.timestamp.getTime();
>                     }
>                     // don't forget the rest of the code
> {code}
> position.timestamp will be a Date object on Android, so even alert( position.timestamp ) works. On iOS 5, it causes the JS engine to fall over with some fatal error, rendering the whole app useless. You have to replace the code with your own "x = new Date; y = x.getTime();" code. If I saw correctly position.timestamp is non-existent on iOS.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira