Ejemplo n.º 1
0
 public async Task LogoutAsync()
 {
     if (facebookSession != null && facebookSession.LoggedIn)
     {
         await facebookSession.LogoutAsync();
     }
 }
        public async void Logout()
        {
            FBSession currentSessionsession = FBSession.ActiveSession;
            await currentSessionsession.LogoutAsync();

            IsLogged = currentSessionsession.LoggedIn;
        }
Ejemplo n.º 3
0
        private async void LogoutFBButton_Click(object sender, RoutedEventArgs e)
        {
            FBSession clicnt = FBSession.ActiveSession;

            if (clicnt.LoggedIn)
            {
                await clicnt.LogoutAsync();
            }
        }
Ejemplo n.º 4
0
        /*Logs the user out of facebook, erases the database and reverts back to default views etc
         */
        private async void LogOut()
        {
            await session.LogoutAsync();

            DeleteFromDB();
            OnLogin();
            DefaultView();
            BingMap.Children.Clear();
            _tempInfoDict.Clear();
            _geoLocDict.Clear();
        }
        async void Logout()
        {
            FBSession sess = FBSession.ActiveSession;
            await sess.LogoutAsync();

            var onlineUser = new OnlineUsers {
                Id = "user_" + userUniqueID + "_id_" + randomID, username = String.Format("{0}", userUniqueID)
            };
            await usersTable.DeleteAsync(onlineUser);

            await SetUIState(false);
        }
Ejemplo n.º 6
0
        private async void login_OnClicked(object sender, RoutedEventArgs e)
        {
            FBSession sess = FBSession.ActiveSession;

            if (sess.LoggedIn)
            {
                LoginButton.Content = "Login";
                await sess.LogoutAsync();

                //Navigate back to same page, to clear out logged in info.
                App.RootFrame.Navigate(typeof(MainPage));
            }
            else
            {
                LoginButton.Content = "Logout";

                FBResult result = await sess.LoginAsync(BuildPermissions());

                // There may be other cases where an a failed login request should
                // prompt the app to retry login, but this one is common enough that
                // it's helpful to demonstrate handling it here.  If the predicate
                // returns TRUE, the user has gone to facebook.com in the browser,
                // and removed our app from their list off allowed apps in Settings.
                if (WasAppPermissionRemovedByUser(result))
                {
                    await sess.LogoutAsync();
                }
                else if (ShouldRerequest(result))
                {
                    await TryRerequest(false);
                }
                else if (result.Succeeded)
                {
                    //Navigate back to same page, to clear out logged in info.
                    App.RootFrame.Navigate(typeof(UserInfo));
                }
            }
        }
Ejemplo n.º 7
0
        private async void logout_Click(object sender, RoutedEventArgs e)
        {
            FBSession clicnt = FBSession.ActiveSession;

            if (clicnt.LoggedIn)
            {
                await clicnt.LogoutAsync();

                App.IsLogged = false;
            }
            IsLogged.Text        = "Successfully logged out";
            SquarePicture.UserId = "";
            login.Visibility     = Visibility.Visible;
            logout.Visibility    = Visibility.Collapsed;
        }