簡體   English   中英

Apple 會拒絕這種在 Xamarin iOS 中獲取唯一 ID 的解決方案嗎?

[英]Will Apple reject this solution for getting unique id in Xamarin iOS?

我想知道Apple是否會拒絕此解決方案以獲得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();
    }
}

Apple 會拒絕這種在 Xamarin iOS 中獲取唯一 ID 的解決方案嗎?

Apple 可能會拒絕使用私有框架/api 的應用程序。

但是,您在代碼中使用的相關框架是Security ,它是公共的。

所以,答案是:沒有。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM