{ "id": "154009", "key": "TIMOB-20173", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-05-20T16:25:31.000+0000", "created": "2015-12-23T00:15:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-5.4.0" ], "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": "50204", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "154084", "key": "TIMOB-20185", "fields": { "summary": "Windows: Documention on custom capabilities", "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": "Medium", "id": "3" }, "issuetype": { "id": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-06-15T19:53:01.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": "On Windows 10, {{Ti.Platform.username}} always returns empty string. FYI internally we are using {{Windows::System::User::FindAllAsync}} and {{User::GetPropertyAsync(KnownUserProperties::AccountName)}} to get the accound info on Windows 10.", "attachment": [ { "id": "59317", "filename": "windows_accounts.png", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-19T17:31:53.000+0000", "size": 51952, "mimeType": "image/png" }, { "id": "59322", "filename": "windows_local.PNG", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-19T21:58:04.000+0000", "size": 5104, "mimeType": "image/png" }, { "id": "59321", "filename": "windows_ms.PNG", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-19T21:58:04.000+0000", "size": 5855, "mimeType": "image/png" } ], "flagged": false, "summary": "Windows: Ti.Platform.username on Windows 10", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 627, "state": "closed", "name": "2016 Sprint 10 SDK", "startDate": "2016-05-07T00:43:56.954Z", "endDate": "2016-05-21T00:43:00.000Z", "completeDate": "2016-05-23T02:06:04.349Z", "originBoardId": 114 }, { "id": 555, "state": "closed", "name": "2016 Sprint 1 SDK", "startDate": "2016-01-02T01:31:50.127Z", "endDate": "2016-01-16T01:31:00.000Z", "completeDate": "2016-01-18T00:52:43.848Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "373676", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile_windows/pull/517", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-03T01:30:56.000+0000", "updated": "2016-01-03T01:30:56.000+0000" }, { "id": "385548", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "[~gmathews] Tested this and {{Ti.Platform.username}} returns no value. Using the demo code the label is blank, and when including {{Ti.API.info(Ti.Platform.username)}} nothing is returned to the console. Using the same code on iOS returns the correct value. \r\n\r\nTested on: \r\nWindows 10 Pro \r\nWindows Phone 10.0 & 8.1 (Microsoft Lumia 640 LTE) \r\nAppc Studio: 4.6.0.201605030516\r\nTi SDK: 5.3.0.v20160509143032\r\nAppc NPM: 4.2.5-5\r\nAppc Core: 5.3.0-44\r\nNode: v4.4.4", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-12T16:58:23.000+0000", "updated": "2016-05-12T16:58:23.000+0000" }, { "id": "386097", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Reopening Ticket.", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-18T20:32:19.000+0000", "updated": "2016-05-18T20:32:19.000+0000" }, { "id": "386213", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Currently we attempt to retrieve the users {{DisplayName}}, however, sometimes Windows cannot retrieve this information.\r\n\r\nhttps://social.msdn.microsoft.com/Forums/fr-FR/a5af64d0-4908-481e-9254-3ce23cc2d734/uwp-user-getpropertyasyncknownuserpropertiesdisplayname-returns-empty-string?forum=wpdevelop\r\n\r\nI have made a PR that will attempt to obtain the {{AccountName}} or {{DisplayName}} if either is available. If both cannot be retrieved it will fallback onto the users first and last name.\r\n\r\nIt appears Windows uses the first and last name as the username if the user is signed into a Microsoft Account (_Settings > Accounts > Your email and accounts_)\r\n\r\n!windows_accounts.png|thumbnail!!windows_local.PNG|thumbnail!!windows_ms.PNG|thumbnail!\r\n\r\nmaster: https://github.com/appcelerator/titanium_mobile_windows/pull/708\r\n5_3_X: https://github.com/appcelerator/titanium_mobile_windows/pull/707\r\n\r\n*tiapp.xml Capability*\r\n{code}\r\n..\r\n\r\n \r\n \r\n \r\n\r\n...\r\n{code}\r\n\r\n*Test Case*\r\n{code}\r\nvar win = Ti.UI.createWindow(),\r\n lbl = Ti.UI.createLabel({ text: Ti.Platform.username });\r\nwin.add(lbl);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-19T16:32:07.000+0000", "updated": "2016-05-19T21:59:15.000+0000" }, { "id": "386275", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Moved this ticket to 5.4.0 as we need to discuss more on how to get the valid username.", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-05-19T23:25:39.000+0000", "updated": "2016-05-19T23:25:39.000+0000" }, { "id": "386276", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "[~gmathews] To clarify, When I ran {{Ti.Platform.username}} on an iOS device, it returned the system's \"name\". This matches what the documentation states. (see https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform-property-username)\r\n\r\nIn the case of a windows 10 phone, {{Ti.Platform.username}} should ideally return the name found under *Settings > System > About > Device Name*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-05-19T23:27:02.000+0000", "updated": "2016-05-19T23:33:58.000+0000" }, { "id": "386291", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile_windows/pull/708\r\n\r\n{{Titanium.Platform.username}} returns the device name. The {{tiapp.xml}} capability required before is not necessary.", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-20T01:03:11.000+0000", "updated": "2016-05-20T01:06:06.000+0000" }, { "id": "388412", "author": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, Ti.Platform.username now returns the appropriate device name, without the need for Capabilities in the tiapp.xml. Editing the Device name and relaunching the app reflects the change correctly.\r\n\r\nTested on: \r\nWindows 10 Pro \r\nWindows Phone 10.0 (Microsoft Lumia 640 LTE) \r\nAppc Studio: 4.6.0.201605201934\r\nTi SDK: 5.4.0.v20160608165242\r\nAppc NPM: 4.2.7-2\r\nAppc Core: 5.4.0-15\r\nNode: v4.4.5\r\n\r\n*Closing Ticket.*", "updateAuthor": { "name": "htbryant", "key": "htbryant", "displayName": "Harry Bryant", "active": true, "timeZone": "Europe/London" }, "created": "2016-06-15T19:52:42.000+0000", "updated": "2016-06-15T19:52:51.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }