Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CC8C7A8B for ; Fri, 31 Aug 2012 18:35:07 +0000 (UTC) Received: (qmail 62116 invoked by uid 500); 31 Aug 2012 18:35:07 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 62088 invoked by uid 500); 31 Aug 2012 18:35:07 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 62077 invoked by uid 99); 31 Aug 2012 18:35:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 18:35:07 +0000 Date: Sat, 1 Sep 2012 05:35:07 +1100 (NCT) From: "Shazron Abdullah (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1397179830.23902.1346438107578.JavaMail.jiratomcat@arcas> In-Reply-To: <1823143906.6738.1346168469725.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CB-1288) position.timestamp.getTime() fails on iOS, ok on Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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