{ "id": "103214", "key": "AC-1778", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-12-11T05:58:38.000+0000", "created": "2012-10-12T14:00:08.000+0000", "labels": [], "versions": [], "issuelinks": [ { "id": "26867", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "102292", "key": "TIMOB-11192", "fields": { "summary": "Kitchen sink:Phone:Geolocation : Exception is thrown while logging translateErrorCode(e.code)", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:40:40.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "It works every time on the simulator.\r\nI get {} on my device.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\nvar currentLocationLabel = Titanium.UI.createLabel({\r\n\ttext : 'Current Location (One Shot)',\r\n\tfont : {\r\n\t\tfontSize : 12,\r\n\t\tfontWeight : 'bold'\r\n\t},\r\n\tcolor : '#111',\r\n\ttop : 110,\r\n\tleft : 10,\r\n\theight : 15,\r\n\twidth : 300\r\n});\r\nwin.add(currentLocationLabel);\r\n\r\nvar currentLocation = Titanium.UI.createLabel({\r\n\ttext : 'Current Location not fired',\r\n\tfont : {\r\n\t\tfontSize : 11\r\n\t},\r\n\tcolor : '#444',\r\n\ttop : 130,\r\n\tleft : 10,\r\n\theight : 15,\r\n\twidth : 300\r\n});\r\nwin.add(currentLocation);\r\n\r\nTi.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\nTi.Geolocation.distanceFilter = 10;\r\nTi.Geolocation.purpose = \"Geo-Location\";\r\n\r\nfunction translateErrorCode(code) {\r\n\tif (code == null) {\r\n\t\treturn null;\r\n\t}\r\n\tswitch (code) {\r\n\t\tcase Ti.Geolocation.ERROR_LOCATION_UNKNOWN:\r\n\t\t\treturn \"Location unknown\";\r\n\t\tcase Ti.Geolocation.ERROR_DENIED:\r\n\t\t\treturn \"Access denied\";\r\n\t\tcase Ti.Geolocation.ERROR_NETWORK:\r\n\t\t\treturn \"Network error\";\r\n\t\tcase Ti.Geolocation.ERROR_HEADING_FAILURE:\r\n\t\t\treturn \"Failure to detect heading\";\r\n\t\tcase Ti.Geolocation.ERROR_REGION_MONITORING_DENIED:\r\n\t\t\treturn \"Region monitoring access denied\";\r\n\t\tcase Ti.Geolocation.ERROR_REGION_MONITORING_FAILURE:\r\n\t\t\treturn \"Region monitoring access failure\";\r\n\t\tcase Ti.Geolocation.ERROR_REGION_MONITORING_DELAYED:\r\n\t\t\treturn \"Region monitoring setup delayed\";\r\n\t}\r\n}\r\n\r\nTitanium.Geolocation.getCurrentPosition(function(e) {\r\n\tif (!e.success || e.error) {\r\n\t\tcurrentLocation.text = 'error: ' + JSON.stringify(e.error);\r\n\t\tTi.API.info(\"Code translation: \" + translateErrorCode(e.code));\r\n\t\talert('error ' + JSON.stringify(e.error));\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar longitude = e.coords.longitude;\r\n\tvar latitude = e.coords.latitude;\r\n\tvar altitude = e.coords.altitude;\r\n\tvar heading = e.coords.heading;\r\n\tvar accuracy = e.coords.accuracy;\r\n\tvar speed = e.coords.speed;\r\n\tvar timestamp = e.coords.timestamp;\r\n\tvar altitudeAccuracy = e.coords.altitudeAccuracy;\r\n\tTi.API.info('speed ' + speed);\r\n\tcurrentLocation.text = 'long:' + longitude + ' lat: ' + latitude;\r\n\r\n\tTitanium.API.info('geo - current location: ' + new Date(timestamp) + ' long ' + longitude + ' lat ' + latitude + ' accuracy ' + accuracy);\r\n});\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: getCurrentPosition returns {}", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "titanium 3.1.0 master\r\nios sdk 6.0\r\ndevice ios 5.1", "comment": { "comments": [ { "id": "243158", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After adding the translateErrorCode() function to the test case I found that iOS 4.3.5 (possibly iOS 5.1 as well) is returning Ti.Geolocation.ERROR_DENIED. It works fine on iOS 6. Tested with Ti SDK 3.0.2.\r\n\r\nMartin: Can you confirm whether you're getting the same error with the new test case, and also that it returns {} only on iOS 5.1 and not 6.0 (OS regression).\r\n\r\nThanks!", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-20T15:28:19.000+0000", "updated": "2013-03-20T15:28:51.000+0000" }, { "id": "283748", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~farfromrefuge] We tried to reproduce this issue on iOS 5.1 iPad3, built with iOS SDK 6.0, and TiSDK 3.1.0. But we were not able to reproduce it. We can see the current positions on both simulator and device. Please let us know if the issue persists for you.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-11T05:56:57.000+0000", "updated": "2013-12-11T05:58:10.000+0000" }, { "id": "283770", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "I have no idea where it stands right now. So you can close it if you want …", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-12-11T07:47:21.000+0000", "updated": "2013-12-11T07:47:21.000+0000" }, { "id": "283771", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing it as per Martin's reply.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-11T08:26:11.000+0000", "updated": "2013-12-11T08:26:11.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }