You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Mingfeng Wang <mi...@gmail.com> on 2012/10/24 06:30:16 UTC

Device UUID storage

Hey,

    Now the Device UUID is saved in localStorage of html5 for Windows8, so
it is the same if all the projects are in the same domain.
    I want to use a file instead of localStorage, is it necessary? And
where can I save this file?

Mingfeng

Re: Device UUID storage

Posted by Matt Baxter-Reynolds <ma...@amxmobile.com>.
Hi,

Sorry to jump in without background, but on Win8 I think it would make more sense to use the built-in hardware ID that WinRT provides, as below, rather than using createUUID to demand-create a device ID. (The hardware ID would obviously survive a localStorage reset.)
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've created a Jira item to this effect. 
https://issues.apache.org/jira/browse/CB-1702


Hopefully I'm not missing something! As I suggest, I'm new to any prior discussion.

Thanks,
Matt

---------------------------------------------------------------------------------------------------------------------------------------
Matt Baxter-Reynolds (@mbrit)
Independent software development consultant, speaker, author, and trainer.
Windows 8 Specialist. 

Read my blog at ZDNet. Talk to me on Twitter.
.
Coming December 2012: "Programming Windows Store Apps with C#" (O'Reilly)
Come along to the London Windows Store Apps Developer Group

On 24 Oct 2012, at 05:30, Mingfeng Wang <mi...@gmail.com> wrote:

> Hey,
> 
>    Now the Device UUID is saved in localStorage of html5 for Windows8, so
> it is the same if all the projects are in the same domain.
>    I want to use a file instead of localStorage, is it necessary? And
> where can I save this file?
> 
> Mingfeng