Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi,

I am working with metro apps. In that i need to send toast notifications to the app. In order to send only one toast notification for the device i need to have only one channel uri per device. But below mentioned function is returning different guid's if hardware changes.

C#
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);
}



Actually I am using other apps also. for those apps am getting only one toast notification. I want the same thing to be implemented in my app.

please suggest me your ideas.



thanks.
Posted
Updated 14-Jan-14 23:11pm
v2

Hello,
You should use the device's mac address ;)
 
Share this answer
 
Comments
hitech_s 15-Jan-14 12:11pm    
can you please provide a sample code.
Ahmed Bensaid 16-Jan-14 6:00am    
You have some samples on CodeProject ;)
Get MAC address in message box using c#
hitech_s 16-Jan-14 13:22pm    
thanks for your suggestion. but in my project i need an unique device guid we want to figure. MAC address may change. why i want to find out the unique device guid is i need to send a single toast notification for a device.
 
Share this answer
 
Comments
hitech_s 15-Jan-14 5:28am    
thanks for sharing 'mopicus'. i need to identify the device uniquely. i will not create any guid in the app. my requirement is to get the devices unique id. so that i can will maintain only one channel uri to send the toast notification

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900