苹果会因为在Xamarin iOS中获得唯一id而拒绝此解决方案吗?
我想知道苹果是否会因为在Xamarin iOS中获得唯一id而拒绝这个解决方案苹果会因为在Xamarin iOS中获得唯一id而拒绝此解决方案吗?,xamarin,xamarin.forms,xamarin.ios,xamarin.ios-binding,Xamarin,Xamarin.forms,Xamarin.ios,Xamarin.ios Binding,我想知道苹果是否会因为在Xamarin iOS中获得唯一id而拒绝这个解决方案 public string GetIdentifier() { enter code here`var query = new SecRecord(SecKind.GenericPassword); query.Service = NSBundle.MainBundle.BundleIdentifier; query.Account = "UniqueID"; NSData uniq
public string GetIdentifier()
{
enter code here`var query = new SecRecord(SecKind.GenericPassword);
query.Service = NSBundle.MainBundle.BundleIdentifier;
query.Account = "UniqueID";
NSData uniqueId = SecKeyChain.QueryAsData(query);
if (uniqueId == null)
{
query.ValueData = NSData.FromString(System.Guid.NewGuid().ToString());
var err = SecKeyChain.Add(query);
if (err != SecStatusCode.Success && err != SecStatusCode.DuplicateItem)
throw new Exception("Cannot store Unique ID");
return query.ValueData.ToString();
}
else
{
return uniqueId.ToString();
}
}
苹果会因为在Xamarin iOS中获得唯一id而拒绝此解决方案吗
public string GetIdentifier()
{
enter code here`var query = new SecRecord(SecKind.GenericPassword);
query.Service = NSBundle.MainBundle.BundleIdentifier;
query.Account = "UniqueID";
NSData uniqueId = SecKeyChain.QueryAsData(query);
if (uniqueId == null)
{
query.ValueData = NSData.FromString(System.Guid.NewGuid().ToString());
var err = SecKeyChain.Add(query);
if (err != SecStatusCode.Success && err != SecStatusCode.DuplicateItem)
throw new Exception("Cannot store Unique ID");
return query.ValueData.ToString();
}
else
{
return uniqueId.ToString();
}
}
苹果可能会拒绝使用私有框架/api的应用程序
但是,您在代码中使用的相关框架是,它是公共的
因此,答案是:不