Exemplo n.º 1
0
        /// <summary>
        /// Gets the Identity Id corresponding to the credentials retrieved from Cognito.
        /// Note: this setting may change during execution. To be notified of its
        /// new value, attach a listener to IdentityChangedEvent
        /// </summary>
        /// <param name="callback">The callback which is executed when the asynchronous operations is completed</param>
        /// <param name="options">Options for executing asynchronous operation</param>
        public void GetIdentityIdAsync(AmazonCognitoIdentityCallback <string> callback, AsyncOptions options = null)
        {
            options = options == null ? new AsyncOptions() : options;

            CognitoIdentityAsyncExecutor.ExecuteAsync <string>(() =>
            {
                return(GetIdentityId());
            }, options, callback);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns an instance of ImmutableCredentials for this instance
        /// </summary>
        /// <param name="callback">The callback which is executed when the asynchronous operations is completed</param>
        /// <param name="options">Options for executing asynchronous operation</param>
        public void GetCredentialsAsync(AmazonCognitoIdentityCallback <ImmutableCredentials> callback, AsyncOptions options = null)
        {
            options = options == null ? new AsyncOptions() : options;

            CognitoIdentityAsyncExecutor.ExecuteAsync <ImmutableCredentials>(() =>
            {
                return(GetCredentials());
            }, options, callback);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns an instance of ImmutableCredentials for this instance
        /// </summary>
        /// <param name="callback">The callback which is executed when the asynchronous operations is completed</param>
        /// <param name="options">Options for executing asynchronous operation</param>
        public void GetCredentialsAsync(AmazonCognitoIdentityCallback <ImmutableCredentials> callback, AsyncOptions options = null)
        {
            if (UnityEngine.Application.platform == UnityEngine.RuntimePlatform.WebGLPlayer)
            {
                GetCredentialsWebGL(credentials =>
                {
                    var result = new AmazonCognitoIdentityResult <ImmutableCredentials>(credentials);
                    callback(result);
                });
            }
            else
            {
                options = options == null ? new AsyncOptions() : options;

                CognitoIdentityAsyncExecutor.ExecuteAsync <ImmutableCredentials>(() =>
                {
                    return(GetCredentials());
                }, options, callback);
            }
        }
Exemplo n.º 4
0
 public void GetCredentialsAsync(AmazonCognitoIdentityCallback <ImmutableCredentials> callback, AsyncOptions options = null)
 {
     options = ((options == null) ? new AsyncOptions() : options);
     CognitoIdentityAsyncExecutor.ExecuteAsync(() => GetCredentials(), options, callback);
 }
Exemplo n.º 5
0
 public void GetIdentityIdAsync(AmazonCognitoIdentityCallback <string> callback, AsyncOptions options = null)
 {
     options = ((options == null) ? new AsyncOptions() : options);
     CognitoIdentityAsyncExecutor.ExecuteAsync(() => GetIdentityId(), options, callback);
 }