苹果会不会拒绝这个在Xamarin iOS中获取唯一id的解决方案?

问题描述 投票:0回答:1

我想知道在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();
    }
}
xamarin xamarin.forms xamarin.ios xamarin.ios-binding
1个回答
1
投票

苹果会拒绝这个在Xamarin iOS中获取唯一id的解决方案吗?

苹果可能会拒绝使用私有框架api的应用。

但是,你在代码中使用的相关框架是 "Xamarin iOS"。安保 它是公开的。

所以,答案是: {fnTahomafs10bord0shad01cH00FFFF}No.

© www.soinside.com 2019 - 2024. All rights reserved.