{ "id": "161851", "key": "TIMOB-23655", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-10-11T12:42:21.000+0000", "created": "2016-07-19T17:41:41.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity", "qe-5.4.0" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [ { "id": "52227", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "161852", "key": "TIMOB-23656", "fields": { "summary": "Windows: Implement Ti.Media.requestCameraPermissions/hasCameraPermissionsmethods to match iOS and Android behaviour", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "52229", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "151042", "key": "TIMOB-19479", "fields": { "summary": "Parity for Android and iOS on handling of permissions", "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": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-10-13T14:17:17.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h5.Description\r\n\r\nAs part of TIMOB-19479 the Gelocation permissions was rewritten to be consistent across iOS and Android and use Ti.Geolocation.hasPermissions. Windows currently uses a different way to request permissions that can be seen in TIMOB-23389, however it should move to match iOS and Android. A code sample can be found below and a real world example found [in Geocoder|https://github.com/appcelerator-developer-relations/appc-sample-geocoder/blob/stable/app/lib/permissions.js#L59]\r\n\r\n{code}\r\nTi.Geolocation.preferredProvider = \"gps\";\r\n function locationCallback(e) {\r\n if (!e.success || e.error) {\r\n alert(\"error:\" + JSON.stringify(e.error));\r\n return;\r\n }\r\n Ti.API.info(JSON.stringify(e));\r\n var longitude = e.coords.longitude;\r\n var latitude = e.coords.latitude;\r\n };\r\n if (Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS)) {\r\n alert(\"Access already granted!\");\r\n Titanium.Geolocation.addEventListener(\"location\", locationCallback);\r\n } else {\r\n Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {\r\n if (e.success === true) {\r\n alert(\"Access now granted!\");\r\n Titanium.Geolocation.addEventListener(\"location\", locationCallback);\r\n } else {\r\n console.log(\"Access denied, error: \" + e.error);\r\n }\r\n });\r\n }\r\n{code}\r\n\r\nAdditionally to this Ti.Geolocation.hasLocationPermissions should also be implemented to allow a user to check if permissions have already been granted\r\n\r\nh5.Steps to reproduce\r\n\r\n# Run the code above on Windows Platform {{appc run -p windows }}\r\n\r\nh5.Actual result\r\n\r\nYou should be prompted to allow location\r\n\r\nh5.Expected result\r\n\r\nThe app will throw an error as the methods are not implemented", "attachment": [ { "id": "59928", "filename": "request.png", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-27T12:43:42.000+0000", "size": 28053, "mimeType": "image/png" } ], "flagged": false, "summary": "Windows: Implement Ti.Geolocation.requestLocationPermissions/hasLocationPermissions methods to match iOS and Android behaviour", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "Windows 10 Pro\r\nAppc CLI Core: 5.4.0-33\r\nAppc CLI NPM: 4.2.7\r\nTi SDK: 5.3.0.GA, \r\nAppc Studio: 4.7.0.201607130543", "closedSprints": [ { "id": 682, "state": "closed", "name": "2016 Sprint 15 SDK", "startDate": "2016-07-16T00:19:20.819Z", "endDate": "2016-07-30T00:19:00.000Z", "completeDate": "2016-08-01T04:40:11.421Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "391521", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile_windows/pull/789", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-07-26T16:56:27.000+0000", "updated": "2016-07-26T16:56:27.000+0000" }, { "id": "398132", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Reopening ticket:\r\n\r\nOS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-56\r\nAppc NPM: 4.2.8-7\r\nTi SDK: 6.0.0.v20161004202820\r\nAppc Studio: 4.8.0.201609292239\r\nLumia 550 10.0\r\n\r\nWhen I'm using the code in the description I get the following\r\n\r\n* On first launch I am prompted to allow the app to access my location. It looks like my callback that is passed to {{requestLocationPermissions}} is called immediately rather than when I allow/reject access as I would expect. When I click yes or no on the prompt my app then crashes\r\n* On subsequent launches my app crashes on launch\r\n\r\nI see similar behavior when using the example in the PR. I have tried manually adding the location capability myself but this does not fix the issue", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-10-05T15:42:04.000+0000", "updated": "2016-10-05T15:42:04.000+0000" }, { "id": "398558", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I was able to reproduce it. I saw callback is fired twice (before & after the prompt) and then crashed. Started looking into it.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-11T01:36:37.000+0000", "updated": "2016-10-11T01:36:37.000+0000" }, { "id": "398565", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "6_0_X: https://github.com/appcelerator/titanium_mobile_windows/pull/878\r\nmaster: https://github.com/appcelerator/titanium_mobile_windows/pull/879\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-10-11T04:21:15.000+0000", "updated": "2016-10-11T04:21:15.000+0000" }, { "id": "398827", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nOS: Microsoft Windows 10 Pro 10.0.14393\r\nAppc core: 6.0.0-58\r\nAppc NPM: 4.2.8-7\r\nTi SDK: 6.0.0.v20161012201942\r\nAppc Studio: 4.8.0.201610060953\r\nLumia 550 10.0\r\n\r\nBoth pieces of example code now work as expected and [geocoder|https://github.com/appcelerator-developer-relations/appc-sample-geocoder] also works as expected\r\n\r\nClosing ticket", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2016-10-13T14:16:59.000+0000", "updated": "2016-10-13T14:16:59.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }