Reputation: 329
Windows.System.Profile is included in the Desktop and Mobile extensions for UWP, but alas is not included in the IoT extensions for UWP.
So when a UWP app is running on an IoT device like Raspberry Pi, it cannot get a unique device id by calling HardwareIdentification.GetPackageSpecificToken.
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.System.Profile.HardwareIdentification"))
{
var token = HardwareIdentification.GetPackageSpecificToken(null);
}
Is there a way to get a unique device Id for a Raspberry Pi IoT device on UWP?
Thanks
Upvotes: 2
Views: 643
Reputation: 3222
You may try to use App Specific Hardware ID as described here: https://msdn.microsoft.com/en-us/jj553431
Basically, you will not get a device Id that is unique to the device itself, only an ID which makes that ID unique for your app that is running on that device. This is to prevent things like ads gathering too much information about your habits by targetting unique device ID's.
I'm not 100% this satisfies your question, but I hope that it is helpful :)
Upvotes: 0