{ "id": "89487", "key": "TIMOB-8517", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13207", "name": "Sprint 2012-07", "archived": true, "released": true, "releaseDate": "2012-04-08" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-12-10T22:22:31.000+0000", "created": "2012-04-04T14:43:57.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity", "qe-testadded" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [ { "id": "16306", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "86179", "key": "TIMOB-7567", "fields": { "summary": "iOS: Implement Geolocation minispec", "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 } } } }, { "id": "16305", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "86154", "key": "TIMOB-7565", "fields": { "summary": "Android: refactor Geolocation module to support expanded Android functionality", "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": "High", "id": "2" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-12-10T22:22:32.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": "iOS needs to support the two new \"common\" geolocation accuracy settings, by aliasing them to existing properties:\r\n\r\n{{Ti.Geolocation.ACCURACY_HIGH}}\r\n{{Ti.Geolocation.ACCURACY_LOW}}", "attachment": [], "flagged": false, "summary": "iOS: Add Ti.Geolocation.ACCURACY_HIGH / ACCURACY_LOW", "creator": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "189886", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated test from TIMOB-7565 to support cross-platform testing:\r\n\r\n{code:title=app.js}\r\nfunction isAndroid() {\r\n\treturn (Ti.Platform.name === \"android\");\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n    backgroundColor: 'yellow'\r\n});\r\n \r\nif (isAndroid()) {\r\n\tvar providerPassive = Ti.Geolocation.Android.createLocationProvider({\r\n\t    name: Ti.Geolocation.PROVIDER_PASSIVE,\r\n\t    minUpdateDistance: 0.0,\r\n\t    minUpdateTime: 0\r\n\t});\r\n\t \r\n\tvar providerNetwork = Ti.Geolocation.Android.createLocationProvider({\r\n\t    name: Ti.Geolocation.PROVIDER_NETWORK,\r\n\t    minUpdateDistance: 0.0,\r\n\t    minUpdateTime: 5\r\n\t});\r\n\t \r\n\tvar providerGps = Ti.Geolocation.Android.createLocationProvider({\r\n\t    name: Ti.Geolocation.PROVIDER_GPS,\r\n\t    minUpdateDistance: 0.0,\r\n\t    minUpdateTime: 0\r\n\t});\r\n\t \r\n\tvar gpsRule = Ti.Geolocation.Android.createLocationRule({\r\n\t    provider: Ti.Geolocation.PROVIDER_GPS,\r\n\t    minAge: 10000\r\n\t});\r\n}\r\n \r\nif (isAndroid()) {\r\n\tvar button1 = Ti.UI.createButton({\r\n\t    title: 'legacy network',\r\n\t    top: 20,\r\n\t    left: 20\r\n\t});\r\n\tbutton1.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_NETWORK;\r\n\t    Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n\t    Ti.Geolocation.Android.manualMode = false;\r\n\t});\r\n\twin.add(button1);\r\n\t \r\n\tvar button2 = Ti.UI.createButton({\r\n\t    title: 'legacy gps',\r\n\t    top: 70,\r\n\t    left: 20\r\n\t});\r\n\tbutton2.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.preferredProvider = Ti.Geolocation.PROVIDER_GPS;\r\n\t    Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n\t    Ti.Geolocation.Android.manualMode = false;\r\n\t});\r\n\twin.add(button2);\r\n}\r\n \r\nvar button3 = Ti.UI.createButton({\r\n    title: 'simple low',\r\n    top: 120,\r\n    left: 20\r\n});\r\nbutton3.addEventListener('click', function(e) {\r\n    Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_LOW;\r\n\tif (isAndroid()) {\r\n    \tTi.Geolocation.Android.manualMode = false;\r\n\t}\r\n});\r\nwin.add(button3);\r\n \r\nvar button4 = Ti.UI.createButton({\r\n    title: 'simple high',\r\n    top: 170,\r\n    left: 20\r\n});\r\nbutton4.addEventListener('click', function(e) {\r\n    Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH;\r\n\tif (isAndroid()) {\r\n\t    Ti.Geolocation.Android.manualMode = false;\r\n\t}\r\n});\r\nwin.add(button4);\r\n \r\nif (isAndroid()) {\r\n\tvar button5 = Ti.UI.createButton({\r\n\t    title: 'manual network',\r\n\t    top: 20,\r\n\t    right: 20\r\n\t});\r\n\tbutton5.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.Android.removeLocationProvider(providerPassive);\r\n\t    Ti.Geolocation.Android.removeLocationProvider(providerGps);\r\n\t    Ti.Geolocation.Android.addLocationProvider(providerNetwork);\r\n\t    Ti.Geolocation.Android.manualMode = true;\r\n\t});\r\n\twin.add(button5);\r\n\t \r\n\tvar button6 = Ti.UI.createButton({\r\n\t    title: 'manual network+gps',\r\n\t    top: 70,\r\n\t    right: 20\r\n\t});\r\n\tbutton6.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.Android.removeLocationProvider(providerPassive);\r\n\t    Ti.Geolocation.Android.addLocationProvider(providerNetwork);\r\n\t    Ti.Geolocation.Android.addLocationProvider(providerGps);\r\n\t    Ti.Geolocation.Android.manualMode = true;\r\n\t});\r\n\twin.add(button6);\r\n\t \r\n\tvar button7 = Ti.UI.createButton({\r\n\t    title: 'manual gps',\r\n\t    top: 120,\r\n\t    right: 20\r\n\t});\r\n\tbutton7.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.Android.removeLocationProvider(providerPassive);\r\n\t    Ti.Geolocation.Android.removeLocationProvider(providerNetwork);\r\n\t    Ti.Geolocation.Android.addLocationProvider(providerGps);\r\n\t    Ti.Geolocation.Android.manualMode = true;\r\n\t});\r\n\twin.add(button7);\r\n\t \r\n\tvar button8 = Ti.UI.createButton({\r\n\t    title: 'gps rule on',\r\n\t    top: 170,\r\n\t    right: 20\r\n\t});\r\n\tbutton8.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.Android.addLocationRule(gpsRule);\r\n\t});\r\n\twin.add(button8);\r\n\t \r\n\tvar button9 = Ti.UI.createButton({\r\n\t    title: 'gps rule off',\r\n\t    top: 170,\r\n\t    right: 110\r\n\t});\r\n\tbutton9.addEventListener('click', function(e) {\r\n\t    Ti.Geolocation.Android.removeLocationRule(gpsRule);\r\n\t});\r\n\twin.add(button9);\r\n}\r\n  \r\nvar currentLocationLabel = Titanium.UI.createLabel({\r\n    text:'Current Location (One Shot)',\r\n    font:{fontSize:12, fontWeight:'bold'},\r\n    color:'#111',\r\n    top:260,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(currentLocationLabel);\r\n \r\nvar currentLocation = Titanium.UI.createLabel({\r\n    text:'Current Location not fired',\r\n    font:{fontSize:11},\r\n    color:'#444',\r\n    top:280,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(currentLocation);\r\n \r\nvar updatedLocationLabel = Titanium.UI.createLabel({\r\n    text:'Updated Location',\r\n    font:{fontSize:12, fontWeight:'bold'},\r\n    color:'#111',\r\n    top:300,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(updatedLocationLabel);\r\n \r\nvar updatedLocation = Titanium.UI.createLabel({\r\n    text:'Updated Location not fired',\r\n    font:{fontSize:11},\r\n    color:'#444',\r\n    top:320,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(updatedLocation);\r\n \r\nvar updatedLatitude = Titanium.UI.createLabel({\r\n    text:'',\r\n    font:{fontSize:11},\r\n    color:'#444',\r\n    top:340,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(updatedLatitude);\r\n \r\nvar updatedLocationAccuracy = Titanium.UI.createLabel({\r\n    text:'',\r\n    font:{fontSize:11},\r\n    color:'#444',\r\n    top:360,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(updatedLocationAccuracy);\r\n \r\nvar updatedLocationTime = Titanium.UI.createLabel({\r\n    text:'',\r\n    font:{fontSize:11},\r\n    color:'#444',\r\n    top:380,\r\n    left:10,\r\n    height:15,\r\n    width:300\r\n});\r\nwin.add(updatedLocationTime);\r\n\r\nTitanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n \r\nfunction translateErrorCode(code) {\r\n    if (code == null) {\r\n        return null;\r\n    }\r\n    switch (code) {\r\n        case Ti.Geolocation.ERROR_LOCATION_UNKNOWN:\r\n            return \"Location unknown\";\r\n        case Ti.Geolocation.ERROR_DENIED:\r\n            return \"Access denied\";\r\n        case Ti.Geolocation.ERROR_NETWORK:\r\n            return \"Network error\";\r\n        case Ti.Geolocation.ERROR_HEADING_FAILURE:\r\n            return \"Failure to detect heading\";\r\n        case Ti.Geolocation.ERROR_REGION_MONITORING_DENIED:\r\n            return \"Region monitoring access denied\";\r\n        case Ti.Geolocation.ERROR_REGION_MONITORING_FAILURE:\r\n            return \"Region monitoring access failure\";\r\n        case Ti.Geolocation.ERROR_REGION_MONITORING_DELAYED:\r\n            return \"Region monitoring setup delayed\";\r\n    }\r\n}\r\n \r\nvar locationCallback = function(e) {\r\n    if (!e.success || e.error)\r\n    {\r\n        updatedLocation.text = 'error:' + JSON.stringify(e.error);\r\n        updatedLatitude.text = '';\r\n        updatedLocationAccuracy.text = '';\r\n        updatedLocationTime.text = '';\r\n        Ti.API.info(\"Code translation: \"+translateErrorCode(e.code));\r\n \r\n        return;\r\n    }\r\n \r\n    var longitude = e.coords.longitude;\r\n    var latitude = e.coords.latitude;\r\n    var altitude = e.coords.altitude;\r\n    var heading = e.coords.heading;\r\n    var accuracy = e.coords.accuracy;\r\n    var speed = e.coords.speed;\r\n    var timestamp = e.coords.timestamp;\r\n    var altitudeAccuracy = e.coords.altitudeAccuracy;\r\n \r\n    updatedLocation.text = 'long:' + longitude;\r\n    updatedLatitude.text = 'lat: '+ latitude;\r\n    updatedLocationAccuracy.text = 'accuracy:' + accuracy;\r\n    updatedLocationTime.text = 'timestamp:' +new Date(timestamp);\r\n \r\n    updatedLatitude.color = 'red';\r\n    updatedLocation.color = 'red';\r\n    updatedLocationAccuracy.color = 'red';\r\n    updatedLocationTime.color = 'red';\r\n    setTimeout(function()\r\n    {\r\n        updatedLatitude.color = '#444';\r\n        updatedLocation.color = '#444';\r\n        updatedLocationAccuracy.color = '#444';\r\n        updatedLocationTime.color = '#444';\r\n    },100);\r\n \r\n    Titanium.API.info('geo - location updated: ' + new Date(timestamp) + ' long ' + longitude + ' lat ' + latitude + ' accuracy ' + accuracy);\r\n};\r\nTitanium.Geolocation.addEventListener('location', locationCallback);\r\n \r\nwin.open();\r\n{code}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-04T15:21:23.000+0000", "updated": "2012-04-04T15:21:23.000+0000" }, { "id": "190017", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PRs https://github.com/appcelerator/titanium_mobile/pull/1931 and https://github.com/appcelerator/titanium_mobile/pull/1941 are merged ", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-04-05T12:33:31.000+0000", "updated": "2012-04-05T12:48:58.000+0000" }, { "id": "198409", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified feature working as expected with SDK 2.1.0.v20120612170248", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-13T17:05:38.000+0000", "updated": "2012-06-13T17:05:38.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }