/// <summary>
 ///     Login in Souq.com using Facebook Account
 /// </summary>
 /// <param name="email"> Facebook email address or telephone number</param>
 /// <param name="password">Facebook password</param>
 public void LoginUsingFacebook(string email, string password)
 {
     FacebookButton.Click();
     DriverWait.Until(ExpectedConditions.UrlContains("facebook.com"));
     FacebookEmailTextBox.SendKeys(email);
     FacebookPasswordTextBox.SendKeys(password);
     FacebookLoginButton.Click();
 }
Example #2
0
        public async void OnAuthenticationCompleted(FacebookOAuthToken token)
        {
            DismissViewController(true, null);

            var facebookService = new FacebookService();
            var email           = await facebookService.GetEmailAsync(token.AccessToken);

            FacebookLoginButton.SetTitle($"Connected with {email}", UIControlState.Normal);
        }
        void ReleaseDesignerOutlets()
        {
            if (EmailText != null)
            {
                EmailText.Dispose();
                EmailText = null;
            }

            if (InputLayout != null)
            {
                InputLayout.Dispose();
                InputLayout = null;
            }

            if (LoginButton != null)
            {
                LoginButton.Dispose();
                LoginButton = null;
            }

            if (LoginLayout != null)
            {
                LoginLayout.Dispose();
                LoginLayout = null;
            }

            if (LogoImage != null)
            {
                LogoImage.Dispose();
                LogoImage = null;
            }

            if (PasswordText != null)
            {
                PasswordText.Dispose();
                PasswordText = null;
            }

            if (RegisterButton != null)
            {
                RegisterButton.Dispose();
                RegisterButton = null;
            }

            if (VerifyButton != null)
            {
                VerifyButton.Dispose();
                VerifyButton = null;
            }

            if (FacebookLoginButton != null)
            {
                FacebookLoginButton.Dispose();
                FacebookLoginButton = null;
            }
        }
Example #4
0
        void UpdateView()
        {
            var profile = SL.Profile;

            if (profile != null)
            {
                CheckNetworks();
                ScoreImage.Image = UIImage.FromBundle("ob-score-bg");
            }
            else
            {
                ScoreFill.Image  = null;
                ScoreImage.Image = UIImage.FromBundle("SLCircleLogo");
            }

            if (SL.IsNetworkConnected("Facebook"))
            {
                FacebookConnectedImage.Image = UIImage.FromBundle("check-icon_green");
                FacebookLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_fb-connected"), UIControlState.Normal);
            }
            else
            {
                FacebookConnectedImage.Image = null;
                FacebookLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_fb-unconnected"), UIControlState.Normal);
            }

            if (SL.IsNetworkConnected("Twitter"))
            {
                TwitterConnectedImage.Image = UIImage.FromBundle("check-icon_green");
                TwitterLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_twitter-connected"), UIControlState.Normal);
            }
            else
            {
                TwitterConnectedImage.Image = null;
                TwitterLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_twitter-unconnected"), UIControlState.Normal);
            }

            if (SL.IsNetworkConnected("Instagram"))
            {
                InstagramConnectedImage.Image = UIImage.FromBundle("check-icon_green");
                InstagramLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_insta-connected"), UIControlState.Normal);
            }
            else
            {
                InstagramConnectedImage.Image = null;
                InstagramLoginButton.SetBackgroundImage(UIImage.FromBundle("social-connect_insta-unconnected"), UIControlState.Normal);
            }

            NextButton.Enabled  = SL.HasNetworks;
            LogoutButton.Hidden = SL.NetworkList == null || SL.NetworkList.Count == 0;
        }
Example #5
0
        protected override void InitView()
        {
            base.InitView();

            _anonymousLogin = new UILabel
            {
                Lines = 0,
                Text  = Translator.GetText("AnonymousLoginString")
            }.ChangeLabelStyle(UIFont.SystemFontOfSize(17f, UIFontWeight.Regular),
                               17f, UIColor.Black, false, UITextAlignment.Center);

            _facebookLogin = new FacebookLoginButton()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
        }
Example #6
0
        public void OnOAuthLoginCompleted(LoginFacebookPanel loginFacebook)
        {
            if (loginFacebook.LoginSuccessful)
            {
                MainWindow.Instance.ShowLoadingPanel();

                SocialLoginCompleteLabel.Text = String.Format(
                    SocialLoginCompleteLabel.Text,
                    "Facebook",
                    "Twitter"
                    );

                FacebookLoginButton.Hide();
                SocialLinkWorker.RunWorkerAsync(loginFacebook.FacebookApi);
            }
            else
            {
                SocialLoginErrorLabel.Show();
            }
        }
Example #7
0
        private void SocialLinkWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                if (FacebookLoginButton.Visible || TwitterLoginButton.Visible)
                {
                    SocialLoginCompleteLabel.Show();

                    MainWindow.Instance.RemoveFromHistory <LoginTwitterPanel>();
                    MainWindow.Instance.RemoveFromHistory <LoginFacebookPanel>();
                    MainWindow.Instance.HideLoadingPanel();
                }
                else
                {
                    MainWindow.Instance.NextPanel <ProfilePanel>();
                }
            }
            else
            {
                if (e.Error is KMSWrongUserCredentials)
                {
                    SocialLoginErrorLabel.Show();

                    if (e.Result is FacebookClient)
                    {
                        FacebookLoginButton.Show();
                    }
                    else
                    {
                        TwitterLoginButton.Show();
                    }
                }
                else
                {
                    throw e.Error;
                }
            }
        }
 public MyFacebookCallback(FacebookLoginButton view)
 {
     this._view = view;
 }
        void ReleaseDesignerOutlets()
        {
            if (AddPointsText != null)
            {
                AddPointsText.Dispose();
                AddPointsText = null;
            }

            if (AreaCollection != null)
            {
                AreaCollection.Dispose();
                AreaCollection = null;
            }

            if (AreaCollectionHeight != null)
            {
                AreaCollectionHeight.Dispose();
                AreaCollectionHeight = null;
            }

            if (BkgdImage != null)
            {
                BkgdImage.Dispose();
                BkgdImage = null;
            }

            if (BtnPendingRequest != null)
            {
                BtnPendingRequest.Dispose();
                BtnPendingRequest = null;
            }

            if (CityLabel != null)
            {
                CityLabel.Dispose();
                CityLabel = null;
            }

            if (cnsAreaCollectionTop != null)
            {
                cnsAreaCollectionTop.Dispose();
                cnsAreaCollectionTop = null;
            }

            if (cnsMenuContainerHeight != null)
            {
                cnsMenuContainerHeight.Dispose();
                cnsMenuContainerHeight = null;
            }

            if (ConnectedNetworkText != null)
            {
                ConnectedNetworkText.Dispose();
                ConnectedNetworkText = null;
            }

            if (FacebookConnectedImage != null)
            {
                FacebookConnectedImage.Dispose();
                FacebookConnectedImage = null;
            }

            if (FacebookLabel != null)
            {
                FacebookLabel.Dispose();
                FacebookLabel = null;
            }

            if (FacebookLoginButton != null)
            {
                FacebookLoginButton.Dispose();
                FacebookLoginButton = null;
            }

            if (FriendsCountText != null)
            {
                FriendsCountText.Dispose();
                FriendsCountText = null;
            }

            if (InfoLabel != null)
            {
                InfoLabel.Dispose();
                InfoLabel = null;
            }

            if (InstagramConnectedImage != null)
            {
                InstagramConnectedImage.Dispose();
                InstagramConnectedImage = null;
            }

            if (InstagramLabel != null)
            {
                InstagramLabel.Dispose();
                InstagramLabel = null;
            }

            if (InstaLoginButton != null)
            {
                InstaLoginButton.Dispose();
                InstaLoginButton = null;
            }

            if (MainView != null)
            {
                MainView.Dispose();
                MainView = null;
            }

            if (NameLabel != null)
            {
                NameLabel.Dispose();
                NameLabel = null;
            }

            if (NetworksContainer != null)
            {
                NetworksContainer.Dispose();
                NetworksContainer = null;
            }

            if (PositionLabel != null)
            {
                PositionLabel.Dispose();
                PositionLabel = null;
            }

            if (ProfileImage != null)
            {
                ProfileImage.Dispose();
                ProfileImage = null;
            }

            if (Score != null)
            {
                Score.Dispose();
                Score = null;
            }

            if (ScoreImage != null)
            {
                ScoreImage.Dispose();
                ScoreImage = null;
            }

            if (scrlMainContent != null)
            {
                scrlMainContent.Dispose();
                scrlMainContent = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }

            if (TableViewHeight != null)
            {
                TableViewHeight.Dispose();
                TableViewHeight = null;
            }

            if (TwitterConnectedImage != null)
            {
                TwitterConnectedImage.Dispose();
                TwitterConnectedImage = null;
            }

            if (TwitterLabel != null)
            {
                TwitterLabel.Dispose();
                TwitterLabel = null;
            }

            if (TwitterLoginButton != null)
            {
                TwitterLoginButton.Dispose();
                TwitterLoginButton = null;
            }

            if (vMenuTableContainer != null)
            {
                vMenuTableContainer.Dispose();
                vMenuTableContainer = null;
            }

            if (vMenuTableInset != null)
            {
                vMenuTableInset.Dispose();
                vMenuTableInset = null;
            }

            if (vProfileInfoContainer != null)
            {
                vProfileInfoContainer.Dispose();
                vProfileInfoContainer = null;
            }
        }
 public CustomAccessTokenTracker(FacebookLoginButton element)
 {
     Element = element;
 }
Example #11
0
        void ReleaseDesignerOutlets()
        {
            if (BtnPrivacyPolicy != null)
            {
                BtnPrivacyPolicy.Dispose();
                BtnPrivacyPolicy = null;
            }

            if (BtnTermsService != null)
            {
                BtnTermsService.Dispose();
                BtnTermsService = null;
            }

            if (DoneButton != null)
            {
                DoneButton.Dispose();
                DoneButton = null;
            }

            if (DoneButtonStackView != null)
            {
                DoneButtonStackView.Dispose();
                DoneButtonStackView = null;
            }

            if (DoneButtonView != null)
            {
                DoneButtonView.Dispose();
                DoneButtonView = null;
            }

            if (FacebookConnectedImage != null)
            {
                FacebookConnectedImage.Dispose();
                FacebookConnectedImage = null;
            }

            if (FacebookLoginButton != null)
            {
                FacebookLoginButton.Dispose();
                FacebookLoginButton = null;
            }

            if (InstagramConnectedImage != null)
            {
                InstagramConnectedImage.Dispose();
                InstagramConnectedImage = null;
            }

            if (InstagramLoginButton != null)
            {
                InstagramLoginButton.Dispose();
                InstagramLoginButton = null;
            }

            if (LogoutButton != null)
            {
                LogoutButton.Dispose();
                LogoutButton = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }

            if (prb_Value != null)
            {
                prb_Value.Dispose();
                prb_Value = null;
            }

            if (ProgressBar != null)
            {
                ProgressBar.Dispose();
                ProgressBar = null;
            }

            if (ProgressBarandNextButtonView != null)
            {
                ProgressBarandNextButtonView.Dispose();
                ProgressBarandNextButtonView = null;
            }

            if (ProgressBarNextButtonStackView != null)
            {
                ProgressBarNextButtonStackView.Dispose();
                ProgressBarNextButtonStackView = null;
            }

            if (ScoreFill != null)
            {
                ScoreFill.Dispose();
                ScoreFill = null;
            }

            if (ScoreImage != null)
            {
                ScoreImage.Dispose();
                ScoreImage = null;
            }

            if (TwitterConnectedImage != null)
            {
                TwitterConnectedImage.Dispose();
                TwitterConnectedImage = null;
            }

            if (TwitterLoginButton != null)
            {
                TwitterLoginButton.Dispose();
                TwitterLoginButton = null;
            }
        }