using System;
using TINK.Model.Device;
using TINK.UWP.Device;
using Windows.System.Profile;
using Windows.UI.Xaml;
[assembly: Xamarin.Forms.Dependency(typeof(WinPhoneDevice))]
namespace TINK.UWP.Device
{
public class WinPhoneDevice : IDevice
{
/// Gets unitque device identifier.
/// Gets the identifies specifying device.
public string GetIdentifier()
{
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);
}
/// Close the application.
public void CloseApplication()
{
Application.Current.Exit();
}
}
}