コード例 #1
0
        void HandleGetIdentityIdCallback(AmazonCognitoIdentityResult <Amazon.Runtime.ImmutableCredentials> result, string guestName)
        {
            if (result.Exception != null)
            {
                Debug.LogError(result.Exception);
                Status = LoginStatus.LoggedOut;
                return;
            }

            Debug.Log("Current Identity is now: " + m_credentials.GetCachedIdentityId());

            if (guestName != null)
            {
                if (IsAuthenticated)
                {
                    m_guestIdCache.ClearGuestById(m_credentials.GetCachedIdentityId());
                }
                else
                {
                    m_guestIdCache.Add(guestName, m_credentials.GetCachedIdentityId());
                }
                m_guestIdCache.StoreGuestIds();
            }

            Status = result.Response == null ? LoginStatus.LoggedOut : LoginStatus.LoggedIn;
        }
コード例 #2
0
 private void CognitoGetCredentialsCallback(AmazonCognitoIdentityResult <ImmutableCredentials> result)
 {
     // if no exception, start the HTTP Get request
     //if (result.Exception == null)
     //  StartCoroutine(AuthenticatedGet((ImmutableCredentials)result.Response));
     //else
     //  Debug.LogException(result.Exception);
 }
 private void CognitoGetCredentialsCallback(AmazonCognitoIdentityResult <ImmutableCredentials> result)
 {
     if (result.Exception == null)
     {
         Log(string.Format("Cognito credentials: {0},\n{1},\n,{2}", result.Response.AccessKey, result.Response.SecretKey, result.Response.Token));
         immutableCredentials = result.Response;
     }
     else
     {
         Log(result.Exception);
     }
 }
コード例 #4
0
        private static void OnIdentityReceived(AmazonCognitoIdentityResult <string> result)
        {
            if (result.Exception != null)
            {
                _log.Debug("Initialization failed");
                _log.Error(result.Exception);
                OnInitializationFailed?.Invoke(result.Exception);
                return;
            }

            _identityId = result.Response;

            _itemsDataSet = _syncManager.OpenOrCreateDataset("gameItems");
            _itemsDataSet.OnSyncSuccess += OnSyncSuccess;
            _itemsDataSet.OnSyncFailure += OnSyncFailure;

            _log.Debug($"Identity received. IdentityId: {_identityId}");

            SyncImpl();
        }