{ "id": "101204", "key": "TIMOB-10921", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14157", "description": "Sprint 2012-20 API", "name": "Sprint 2012-20 API", "archived": true, "released": true, "releaseDate": "2012-10-08" }, { "id": "14272", "description": "2012 Sprint 20", "name": "2012 Sprint 20", "archived": true, "released": true, "releaseDate": "2012-10-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-05T17:32:16.000+0000", "created": "2012-09-14T14:17:10.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "SupportTeam", "api", "qe-port" ], "versions": [ { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-12-04T19:28:46.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h6.Problem\r\nTi.Geolocation.getCurrentPosition() method does not work in conjunction with a Ti.Geolocation.addEventListener('location', ...), the getCurrentPosition callback event is never called.\r\n\r\nh6.Tested on\r\niOS simulator 5.1 & iphone 4\r\n\r\nh6.Steps to reproduce\r\n1. run the code. No pause/resume events needed. \r\n2. From a fresh launch, the button will do nothing if line 40 is uncommented.\r\n\r\nh6.Repro sequence\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win = Titanium.UI.createWindow({ \r\n \ttitle: 'test'\r\n});\r\n\r\nTi.Geolocation.trackSignificantLocationChange = true;\r\nTitanium.Geolocation.distanceFilter = 10;\r\nTitanium.Geolocation.purpose = \"Testing\";\r\n\r\nvar n=0, notification = [];\r\nvar locationCallback = function(e){\r\n\tvar longitude = e.coords.longitude;\r\n var latitude = e.coords.latitude;\r\n \r\n\tnotification[n] = Titanium.App.iOS.scheduleLocalNotification({ \r\n\t\talertBody: 'long: ' + longitude + '\\nlat: ' + latitude,\r\n\t\talertAction:\"View App\",\r\n\t\tuserInfo:{\"hello\":\"world\"},\r\n\t\tdate: new Date()\r\n\t});\r\n\t//alert(e)\r\n\tn++;\r\n};\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'Get Location',\r\n\twidth: Ti.UI.SIZE,\r\n\theight: Ti.UI.SIZE\r\n});\r\nwin.add(btn);\r\n\r\nbtn.addEventListener('click', function(){\r\n\tTi.Geolocation.getCurrentPosition(function(e){\t\t \r\n\t alert(e.coords);\r\n\t});\r\n})\r\n\r\n//Ti.Geolocation.addEventListener('location', locationCallback);\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.Geolocation 'location' event doesn't play nice with getCurrentPosition method", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 2.1.2.GA & 3.0 CI build\r\niOS 5.1", "closedSprints": [ { "id": 3, "state": "closed", "name": "Release 3.0.0", "startDate": "2012-09-27T05:26:46.636Z", "endDate": "2012-10-08T20:05:00.000Z", "completeDate": "2012-12-20T17:03:19.403Z" } ], "comment": { "comments": [ { "id": "220750", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/3041", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-25T20:43:33.000+0000", "updated": "2012-09-25T20:43:33.000+0000" }, { "id": "222272", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "CR & FR ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-05T17:32:16.000+0000", "updated": "2012-10-05T17:32:16.000+0000" }, { "id": "229899", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 3.0.0.v20121130200208 on iPhone 4 5.1.1", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-04T19:28:46.000+0000", "updated": "2012-12-04T19:28:46.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }