{ "id": "153382", "key": "TIMOB-20046", "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": [], "resolution": null, "resolutiondate": null, "created": "2015-11-23T14:27:56.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "issuelinks": [ { "id": "50245", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "149123", "key": "TIMOB-19071", "fields": { "summary": "Ti.Geolocation.getCurrentPosition can have success:true and error at the same time with LiveView", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-11-29T13:38:02.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "For a new training app I did:\r\n\r\n{code:javascript}\r\n\t\t\tTi.Geolocation.getCurrentPosition(function(e) {\r\n\r\n\t\t\t\tconsole.debug('LOCATION: ' + JSON.stringify(e));\r\n\r\n\t\t\t\tif (!e.success) {\r\n\t\t\t\t\treturn showError(e.error || 'Could not find your location');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tgetWeather(e.coords);\r\n\t\t\t});\r\n{code}\r\n\r\nAnd of course in {tiapp.xml}}:\r\n\r\n{code:xml}\r\n\t\tNSLocationAlwaysUsageDescription\r\n Get the weather for your location.\r\n{code}\r\n\r\nBut the response in Simulator was:\r\n\r\n{code}\r\n{\r\n\t\"success\": true,\r\n\t\"code\": 0,\r\n\t\"source\": {},\r\n\t\"type\": \"location\",\r\n\t\"error\": \"The operation couldn’t be completed. (kCLErrorDomain error 0.)\"\r\n}\r\n{code}\r\n\r\nI expected to get {{coords}} of course, but in case of an error at least {{success:false}} instead of {{true}}.\r\n\r\n*NOTE:* The [documentartion|https://appcelerator.github.io/appc-docs/latest/#!/api/LocationResults] only lists {{coords}} and {{provider}} (Android) and not {{success}} and {{error}}.\r\n", "attachment": [], "flagged": false, "summary": "Ti.Geolocation.getCurrentPosition returns success:true with no coords", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.1.0.GA", "comment": { "comments": [ { "id": "443819", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-11-21T17:41:33.000+0000", "updated": "2018-11-22T13:00:03.000+0000" }, { "id": "443870", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Someone with news? I have the same problem with android! Someone can help me?", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-11-25T15:14:02.000+0000", "updated": "2018-11-25T15:14:02.000+0000" }, { "id": "443871", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~otto.pic] what is the content of {{getCurrentPosition()}}? Is it just {{Ti.Geolocation.getCurrentPosition(callback)}} or a you subscribing to the {{location}} event?", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-11-25T20:09:53.000+0000", "updated": "2018-11-25T20:09:53.000+0000" }, { "id": "443872", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "\r\n{code:java}\r\nfunction getCurrentPosition() {\r\n\t\tTi.Geolocation.getCurrentPosition(function(e){\r\n\t\t\t\t\r\n\t\t\t\tif(e.coords){\r\n\t\t\t\t\r\n\t\t\t\t\tgetData({lat: e.coords.latitude, lng: e.coords.longitude});\r\n\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tui.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t});\r\n\t}\r\n{code}", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-11-25T21:10:05.000+0000", "updated": "2018-11-25T21:10:05.000+0000" }, { "id": "443936", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Did you receive a location before? If you don't have a location you'll receive NULL. When I had a location outside my app (with a GPS test tool) {{getCurrentPosition()}} returns my last location. For moving coordingats {{Ti.Geolocation.addEventListener('location', location);}} of course.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-11-27T19:38:37.000+0000", "updated": "2018-11-27T19:38:37.000+0000" }, { "id": "444047", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "I have found the problem but I haven't solution.\r\nIf I install the app with wifi enabled and data and gps disabled there isn't way to get location enabling data and gps too. If I install the app with data and gps enabled all work fine.\r\nI don't understand very well what's append, but how can I get location from the best source wifi, data or gps? ", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-11-29T13:38:02.000+0000", "updated": "2018-11-29T13:38:02.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }