Esempio n. 1
0
        partial void LogoutAction(MonoTouch.Foundation.NSObject sender)
        {
            iOSLoginManager loginManager = iOSLoginManager.Instance;

            loginManager.Logout();

            if (LogoutEvent != null)
            {
                LogoutEvent();
            }
        }
Esempio n. 2
0
        private async Task checkLogin()
        {
            iOSLoginManager loginManager = iOSLoginManager.Instance;
            bool            shouldLogout = NSUserDefaults.StandardUserDefaults.BoolForKey("logout_preference");

            if (shouldLogout)
            {
                loginManager.Logout();
                NSUserDefaults.StandardUserDefaults.SetBool(false, "logout_preference");
            }

            AccountManager acm      = new AccountManager();
            TravelerModel  traveler = await acm.GetTravelerByEmail(loginManager.GetUsername());

            if (traveler != null && !traveler.InformedConsent)
            {
                loginManager.Logout();
            }


            if (!await loginManager.IsLoggedIn())
            {
                PerformSegue("LoginSegue", this);
            }
            else
            {
                UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert |
                                                             UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
                UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);

                if (CLLocationManager.LocationServicesEnabled)
                {
                    mLocationManager.StartUpdatingLocation();
                }

                await UpdateTripDisplays();
            }
        }