private async void LoginFacebook() { string[] readPermissions = { "public_profile", "email" }; var fbtoken = await _dependencyService.Get <IFacebookLoginService>().LoginAsync(readPermissions); IsLoading = true; var userProfile = await _facebookService.GetFacebookProfileAsync(fbtoken); if (userProfile != null) { var response = await _fitMeetRestService.FacebookLoginAsync(userProfile); if (response != null && response.Output?.Status == 1 && response.Output?.Response?.token != null) { var token = response.Output.Response.token; _tokenService.SetToken(token); _fitMeetRestService.SetToken(token); if ((response?.Output?.Validation).Equals("User already exists", StringComparison.CurrentCultureIgnoreCase)) { NavigateCommand.Execute("app:///MainPage/NavigationPage/MainTabbedPage"); } else { NavigateCommand.Execute("SecondSignUpPage"); } } else { await _dialogService.DisplayAlertAsync("Error", "Could not register. Please try again", "Ok"); } } IsLoading = false; }