public void AccessAuthorizationFinished(VKAuthorizationResult result)
 {
     if (result.Token != null)
     {
         StartWorking();
     }
     else if (result.Error != null)
     {
         new UIAlertView(null, "Access denied\n" + result.Error, null, "OK").Show();
     }
 }
Beispiel #2
0
            public override void AccessAuthorizationFinished(VKAuthorizationResult result)
            {
                if (result.Error != null)
                {
                    TCS.SetException(new Exception(result.Error.LocalizedDescription));
                    return;
                }

                if (!TCS.Task.IsCanceled)
                {
                    TCS.TrySetResult(result.Token.AccessToken);
                }
            }
Beispiel #3
0
 public void AccessAuthorizationFinished(VKAuthorizationResult result)
 {
     if (result?.Token == null)
     {
         SetErrorResult(result?.Error?.LocalizedDescription ?? @"VK authorization unknown error");
     }
     else
     {
         _loginResult = new LoginResult
         {
             Token  = result.Token.AccessToken,
             UserId = result.Token.UserId,
             Email  = result.Token.Email,
             //ExpireAt = Utils.FromMsDateTime(result.Token.ExpiresIn),
         };
         Task.Run(GetUserInfo);
     }
 }
        public async void AccessAuthorizationFinished(VKAuthorizationResult result)
        {
            if (result?.Token == null)
            {
                _onLoginComplete?.Invoke(null, result?.Error?.LocalizedDescription ?? "VK login unknown error");
            }
            else
            {
                VKUserModel vkUserModel = new VKUserModel
                {
                    Email  = result.Token.Email,
                    UserID = result.Token.UserId
                };

                await GetUserInfo(vkUserModel);

                _onLoginComplete?.Invoke(vkUserModel, string.Empty);
            }
        }