如何在Xamarin Froms中使用c#获取Android和iOS中的设备唯一ID?我正在使用Azure Notification Hub发送通知。我指的是这个blog。但是在Android中,我找不到相关的“设置”
最佳答案
根据您发布的博文http://codeworks.it/blog/?p=260和简短的问题描述,我尝试回答您的问题。
供Android使用Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
对于iOS,请参阅您的博客文章。或选择保存IdentifierForVendor
,例如在您的AppDelegate
中,并在您的IOSDevice
类中返回此值(使用博客文章中的名称)。
使用UIDevice.CurrentDevice.IdentifierForVendor.ToString()
获取iOS上的设备ID。
关于xamarin.forms - 如何以Xamarin形式获取设备ID?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50232847/