Example #1
0
        public async Task<Boolean> Authenticate()
        {
            AuthRequest request = new AuthRequest();
            request.facebook_token = FbSessionInfo.FacebookToken;
            request.facebook_id = FbSessionInfo.FacebookID;
            AuthResponse response = await request.Send();
            if (response.token.Length > 0)
            {
                _currentUser = response.user;
                _globalInfo = response.globals;
                _currentProfile = await Profile.GetProfile();

                await PingWithLocation();
                await GetUpdate();
                await GetRecommendations();

                StartUpdatesTimer();

                (Application.Current as TinderApp.Library.Controls.IApp).RootFrameInstance.LoggedIn();

                return true;
            }

            return false;
        }
Example #2
0
        public async Task<Boolean> Authenticate()
        {
            AuthRequest request = new AuthRequest();
            request.facebook_token = FbSessionInfo.FacebookToken;
            request.facebook_id = FbSessionInfo.FacebookID;
            AuthResponse response = await request.Send();
            if (response.token.Length > 0)
            {
                _currentUser = response.user;
                _globalInfo = response.globals;
                _currentProfile = await Profile.GetProfile();

                await PingWithLocation();
                await GetUpdate();
                await GetRecommendations();

                Deployment.Current.Dispatcher.BeginInvoke(() =>
                {
                    _updateTimer = new DispatcherTimer();
                    _updateTimer.Interval = TimeSpan.FromMilliseconds(_globalInfo.UpdatesInterval);
                    _updateTimer.Tick += _updateTimer_Tick;
                    _updateTimer.Start();
                });

                return true;
            }

            return false;
        }