You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2012/09/01 02:49:07 UTC

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

     [ 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