incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesse MacFadyen (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (CB-1702) device.uuid should use HardwareIdentification.GetPackageSpecificToken, not utils.createUUID
Date Wed, 24 Oct 2012 10:14:12 GMT

     [ https://issues.apache.org/jira/browse/CB-1702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jesse MacFadyen reassigned CB-1702:
-----------------------------------

    Assignee: mingfeng.wang  (was: Jesse MacFadyen)
    
> device.uuid should use HardwareIdentification.GetPackageSpecificToken, not utils.createUUID
> -------------------------------------------------------------------------------------------
>
>                 Key: CB-1702
>                 URL: https://issues.apache.org/jira/browse/CB-1702
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Windows 8
>            Reporter: Matt Baxter-Reynolds
>            Assignee: mingfeng.wang
>
> The current implementation creates a device ID and puts it in localStorage:
>         // deviceId aka uuid
>         var deviceId = localStorage.deviceId;
>         if(!deviceId) {
>             deviceId = utils.createUUID();
>             console.log(deviceId);
>             localStorage.deviceId = deviceId;
>         }
> This should more properly use WinRT's HardwareIdentification class, e.g.
> private string GetHardwareId()
> {
> var token = HardwareIdentification.GetPackageSpecificToken(null);
> var hardwareId = token.Id;
> var dataReader = Windows.Storage.Streams.DataReader.FromBuffer(hardwareId);
> byte[] bytes = new byte[hardwareId.Length];
> dataReader.ReadBytes(bytes);
> return BitConverter.ToString(bytes);
> }
> (I appreciate that's C# - I've cribbed it from another project, but this should work
in WinJS.)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message