Amazon.CognitoIdentity.CognitoAWSCredentials.GetCachedIdentityId C# (CSharp) Метод

GetCachedIdentityId() публичный Метод

Gets the previously cached the identity id retrieved from Cognito. For Unity, the Identity id is stored in PlayerPrefs
public GetCachedIdentityId ( ) : string
Результат string
        public virtual string GetCachedIdentityId()
        {
            var settings = ServiceFactory.Instance.GetService<IApplicationSettings>();
            return settings.GetValue(GetNamespacedKey(IDENTITY_ID_CACHE_KEY), ApplicationSettingsMode.Local);
        }

Usage Example

 /// <summary>
 /// A helper function to get the identity id of the dataset from credentials
 /// provider. If the identity id is null, UNKNOWN_IDENTITY_ID will be
 /// returned.
 /// </summary>
 /// <returns>The identity identifier.</returns>
 /// <param name="provider">Provider.</param>
 public static string GetIdentityId(CognitoAWSCredentials credentials)
 {
     return string.IsNullOrEmpty(credentials.GetCachedIdentityId())
         ? UNKNOWN_IDENTITY_ID
             : credentials.GetCachedIdentityId();
 }