private void onLoggedIn(ILoginResult aRes) { debug = "Facebook Logged In"; string userid = AccessToken.CurrentAccessToken.UserId; debug = "User: "+userid; PlayerMain.LOCAL.facebookID = userid; }
void LoginCallBack(ILoginResult result) { if (result.Error == null) { Debug.Log ("FB has logged in."); ShowUI (); } else { Debug.Log ("Error during login: " + result.Error); } }
private void fbLoginCallback(ILoginResult result = null) { if (result == null || string.IsNullOrEmpty(result.Error)) { FB.ShareLink(contentURL: new Uri(m_GooglePlayPage), contentTitle: "I just scored on Toewr Balance!", contentDescription: "Think you can beat my score?"); } }
void LoginCallback(ILoginResult result) { Util.Log("LoginCallback"); if (FB.IsLoggedIn) { OnLoggedIn(); } }
private void LoginCallback(ILoginResult result) { Debug.Log ("Trying to log in"); if (result.Error != null) Debug.Log ("FB log in Error: " + result.Error); else if (FB.IsLoggedIn) OnLoggedIn (); else OnLoggedFail (); }
void FBLoggedIn(ILoginResult result) { if (FB.IsLoggedIn) { Debug.Log("Logged In"); loginButton.GetComponentInChildren<Text>().text = "LogOut"; FB.API("/me/picture", HttpMethod.GET, GetPicture); //FB.API("/me?fields=id,name", HttpMethod.GET, GetUserName); work same as /me FB.API("/me", HttpMethod.GET, GetUserName); } }
private void loginResult(ILoginResult result) { if (result.Cancelled || !String.IsNullOrEmpty(result.Error)) { Debug.Log("login Error: " + result.Error); } else if(FB.IsLoggedIn) { // Share succeeded without postID Debug.Log("login success!"); } }
private void AuthCallback (ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's User ID Debug.Log(aToken.UserId); // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log(perm); } } else { Debug.Log("User cancelled login"); } }
void AuthCallBack(ILoginResult result) { if (result.Error != null) { Debug.Log (result.Error); } else { if (FB.IsLoggedIn) { FacebookManager.Instance.IsLoggedIn = true; FacebookManager.Instance.GetProfile (); Debug.Log ("FB is logged in"); } else { Debug.Log ("FB is not logged in"); } DealWithFBMenus (FB.IsLoggedIn); } }
private void AuthCallback (ILoginResult result) { if (FB.IsLoggedIn) { AccessToken aToken = Facebook.Unity.AccessToken.CurrentAccessToken; FBUIInstance = GameObject.Instantiate(FBUIPrefab, Vector3.zero, Quaternion.identity) as GameObject; FBUIInstance.transform.SetParent(MainUIAccessor.Instance.gameObject.transform, false); FBUIInstance.SetActive(true); GetFriendsList(); } else { Debug.Log("Error: " + result.Error); } }
// 페북으로 로그인 콜백 private void FBLoginCallback(ILoginResult result) { if(FB.IsLoggedIn) { // 로그인 됨 Debug.Log("SuccessFul Login"); // 페북 userid 저장 DataManager.fbUserid = AccessToken.CurrentAccessToken.UserId; // 서버로 로그인 시도 ServerManager.m.Post_LoginResult += LoginComplete; ServerManager.m.Post_LoginWithFacebook_f(DataManager.fbUserid); } else { Debug.Log("Login Denied"); // 다음 Scene으로 SceneManager.LoadScene("LobbyScene"); } }
public void LoginCallback(ILoginResult result) { Debug.Log("********** Trying to login"); if(result.Error != null) { Debug.Log("********** FB login error " + result.Error); } else if(FB.IsLoggedIn) { OnLoggedIn(); } else { OnLoggedFail(); } }
private void AuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = AccessToken.CurrentAccessToken; // Print current access token's User ID Debug.Log(aToken.UserId); test1.text = aToken.UserId; CheckAlreadyRegist(); } else { Debug.Log("User cancelled login"); } }
private void AuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's User ID Debug.Log(aToken.UserId); // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log(perm); } FB.API("/me?fields=id,first_name,friends.limit(100).fields(first_name,id)",HttpMethod.GET, APICallback); } else { Debug.Log("User cancelled login"); } }
private void AuthCallback(ILoginResult result){ if(FB.IsLoggedIn){ var accessToken = Facebook.Unity.AccessToken.CurrentAccessToken; GlobalVariables.facebookLogin = true; Debug.Log("Facebook Acess token User ID: "+ accessToken.UserId); Debug.Log("Permissions:"); foreach(string perm in accessToken.Permissions){ Debug.Log(perm); } Task<ParseUser> logInTask = ParseFacebookUtils.LogInAsync(accessToken.UserId, accessToken.TokenString, accessToken.ExpirationTime); SceneManager.LoadScene(SceneBook.MAIN_MENU_NAME); } else{ Debug.Log("Login cancelled."); } }
private static void ValidateToken(ILoginResult loginResult, IEnumerable<string> permissions) { Assert.IsNotNull(loginResult); AccessToken token = AccessToken.CurrentAccessToken; Assert.AreSame(loginResult.AccessToken, loginResult.AccessToken); Assert.IsNotNull(token); // For canvas we can be off by about a second since the token value for expiration time is // returned in the format seconds until expired from now. long diff = token.ExpirationTime.TotalSeconds() - MockResults.MockExpirationTimeValue.TotalSeconds(); Assert.IsTrue(Math.Abs(diff) < 5); Assert.AreEqual(MockResults.MockTokenStringValue, token.TokenString); Assert.AreEqual(MockResults.MockUserIDValue, token.UserId); Assert.AreEqual(permissions.Count(), token.Permissions.Count()); foreach (var perm in permissions) { Assert.IsTrue(token.Permissions.Contains(perm)); } }
public virtual void SetupBaseEnvVariables(ILoginResult result, Process gameProcess) { throw new NotImplementedException("Override for the specific gameserver."); }
void LoginPublishCallback(ILoginResult result) { //You also granted the asked publish_actions permission. }
protected void OnAuthResponse(ILoginResult result) { // If the login is cancelled we won't have a access token. // Don't overwrite a valid token if (result.AccessToken != null) { AccessToken.CurrentAccessToken = result.AccessToken; } foreach (FacebookDelegate<ILoginResult> callback in authDelegates) { if (callback != null) { callback(result); } } authDelegates.Clear(); }
public Task <bool> Validate(ILoginResult token) { return(_wgc.LoginTest(token.AccessToken)); }
private void LoginAuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's User ID Debug.Log("UserId: " + aToken.UserId); // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log("perm: " + perm); } CeresitaWebService.Singleton.user.facebookId = aToken.UserId; CeresitaWebService.Singleton.GetUserByFacebook(CeresitaWebService.Singleton.user.facebookId, delegate(CeresitaWebService.WEBSERVICE_RETURN ret1) { if (ret1 == CeresitaWebService.WEBSERVICE_RETURN.USER_NOT_FOUND) { CeresitaWebService.Singleton.CreateUser(CeresitaWebService.AUTHENTICATION_TYPE.FACEBOOK, CeresitaWebService.Singleton.user.facebookId, delegate(CeresitaWebService.WEBSERVICE_RETURN ret2) { if (ret2 == CeresitaWebService.WEBSERVICE_RETURN.USER_CREATED) { FB.API("/me?fields=name,email", HttpMethod.GET, UserInfoRequestCallback); } else { CeresitaWebService.Singleton.user.facebookId = ""; Alert.Singleton.CloseAlert(true); Alert.Singleton.ShowAlert(Alert.Message.LOGIN_FAILED); } }); } else { FB.API("/me?fields=name,email", HttpMethod.GET, UserInfoRequestCallback); } }); } else { Alert.Singleton.CloseAlert(true); Alert.Singleton.ShowAlert(Alert.Message.LOGIN_FAILED); Debug.Log("Kauel: User cancelled login"); } }
void PublishAuthCallBack(ILoginResult result) { if (result.Error != null) { Debug.Log (result.Error); } else { FacebookManager.Instance.SetScore(); } }
private ClientSideLoginPerformer <string, string> MakeLoginPerformer(string connection, IAuthPromptResponse response, ILoginResult result) { _authPrompterMock.SetupGet(t => t.Response).Returns(response); _authPerformerMock.SetupGet(t => t.Connection).Returns(connection); _authPerformerMock.SetupGet(t => t.Result).Returns(result); _loginErrorHandlerMock.Setup(t => t.Handle(It.IsAny <ILoginResult>())).Callback(new InvocationAction(RegisterLoginErrorHandlerCall)); return(new ClientSideLoginPerformer <string, string>(_handshakePerformerMock.Object, _authPrompterMock.Object, _loginErrorHandlerMock.Object, _authPerformerMock.Object)); }
private void LoginCallback(ILoginResult result) { if (FB.IsLoggedIn) { // facebook ログインの情報を使って NCMB にログインする var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; NCMBFacebookParameters parameters = new NCMBFacebookParameters(aToken.UserId, aToken.TokenString, aToken.ExpirationTime); NCMBUser user = new NCMBUser(); user.AuthData = parameters.param; user.LogInWithAuthDataAsync((NCMBException e) => { if (e != null) { Debug.LogError("Failed to login: "******"Failed to fetch: " + ex.ErrorMessage); } else { if (string.IsNullOrEmpty(user.Email)) { Dictionary <string, string> formData = new Dictionary <string, string>() { }; FB.API("/me?fields=id,email", HttpMethod.GET, (IGraphResult r) => { if (r.Error != null) { Debug.Log(r.Error); } else { Debug.Log(r.ResultDictionary.ToJson()); string email = r.ResultDictionary["email"].ToString(); user.Email = email; user.SaveAsync((NCMBException exc) => { if (exc != null) { Debug.LogError("Failed to save: " + ex.ErrorMessage); } else { Debug.Log("Saved email data successfully."); } }); } } , formData); } } }); } }); } else { Debug.Log("User cancelled login"); } }
//private void OnHideUnity(bool isGameShown) //{ // //Debug.Log("Is game showing? " + isGameShown); //} private void OnLogin(ILoginResult result) { if (!FB.IsLoggedIn || result.Error != null) { Debug.Log("[FacebookProvider] Login failed. Error Response:\n" + result.Error); if (mInitializationFailedCallback != null) { mInitializationFailedCallback.Invoke(); } mInitializationCompleteCallback = null; mInitializationFailedCallback = null; } else { if (AccessToken.CurrentAccessToken != null) { //string player_id = AccessToken.CurrentAccessToken.UserId; var request_data = new Dictionary <string, string>(); request_data["fields"] = PROFILE_FIELDS; FB.API("me", HttpMethod.GET, (IGraphResult response) => { if (AssertResult(response)) { PlayerProfile = PrepareProfile(response.RawResult); Initialized = true; CallInitializationCompleteCallback(); } }, request_data); } FB.GetAppLink(delegate(IAppLinkResult res) { if (!String.IsNullOrEmpty(res.Url)) { string app_link = res.Url; int index = app_link.IndexOf("?"); if (index > 0) { app_link = app_link.Substring(0, app_link.IndexOf('?')); } mAppLink = new Uri(app_link); /* * var index = (new Uri(res.Url)).Query.IndexOf("request_ids"); * if(index != -1) * { * // ...have the user interact with the friend who sent the request, * // perhaps by showing them the gift they were given, taking them * // to their turn in the game with that friend, etc. * } */ } } ); } }
private void HandleOnLoginFailed(ILoginResult result) { IntegrationTest.Fail("Login Failed : " + result); }
private void onMixLoginFailed(ILoginResult result) { Service.Get <ICPSwrveService>().Action("game.login.submit", "fail", result.GetType().Name); Service.Get <ICPSwrveService>().EndTimer("logintimer", null, null, "fail"); }
private void AuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; //aToken.ExpirationTime.AddDays(20); // Print current access token's User ID Debug.Log(aToken.UserId); // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log(perm); if(Logout!=null) Logout.SetActive(true); // Player Logged in. Logout button should be displayed if(Login!=null) Login.SetActive(false); GetPlayerDetails(); } } else { Debug.Log("User cancelled login"); if(Logout!=null) Logout.SetActive(false); // Player not Logged in. Logout button should be displayed if(Login!=null) Login.SetActive(true); } }
private void FacebookOnLogin(ILoginResult result) { Debug.Log("Login Callback;" + FB.IsLoggedIn); try { if (FB.IsLoggedIn) { Debug.Log("a"); if (FirebaseAuth.DefaultInstance.CurrentUser != null) { Debug.Log("User " + FirebaseAuth.DefaultInstance.CurrentUser + " is already logged in! Please log out first!"); } // AccessToken class hat alle session details AccessToken token = AccessToken.CurrentAccessToken; Debug.Log("b"); var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; Debug.Log("Token 1: " + token + "\nToken 2:" + aToken + "\nToken 3:" + userID); if (userID) { userID.text = result.AccessToken.UserId; } Debug.Log(result.AccessToken.UserId); //Credential credential = FacebookAuthProvider.GetCredential(token.TokenString); //c = credential; //temp = true; mAuth = FirebaseAuth.DefaultInstance; Credential credential = FacebookAuthProvider.GetCredential(token.TokenString); Debug.Log(token.ToString() + "\n\n\n" + token.TokenString); //FirebaseAuth.DefaultInstance.CurrentUser.LinkWithCredentialAsync(credential); // FB.API // FirebaseLoginManager.flm.Signup(token.) /* * FirebaseAuth.DefaultInstance.SignInWithCredentialAsync(credential).ContinueWith(task => { * Debug.Log("Continue (" + task.IsCanceled + ";" + task.IsFaulted + ";" + task.IsCompleted+")"); * if (task.IsCanceled) * { * Debug.LogError("SignInWithCredentialAsync was canceled."); * txt += "SignInWithCredentialAsync was canceled."; * res.text = txt; * return; * } * if (task.IsFaulted) * { * Debug.LogError((task == null) ? null : task); * Debug.LogError("SignInWithCredentialAsync encountered an error: " + task.Exception); * txt += "SignInWithCredentialAsync encountered an error: " + task.Exception; * res.text = txt; * return; * } * * res.text = txt; * * Firebase.Auth.FirebaseUser newUser = task.Result; * * txt += "User signed in successfully: " + newUser.DisplayName + "(" + newUser.UserId + ")"; * res.text = txt; * * FirebaseLoginManager.flm.LoginSuccessful(); * * Debug.LogFormat("User signed in successfully: {0} ({1})", * newUser.DisplayName, newUser.UserId); * * res.text = txt; * // Nach dem Login sollen alle Nutzerdaten aktualisiert werden * GetUserData(); * * foreach (string perm in token.Permissions) * { * Debug.Log(perm); * } * });*/ } else { txt += "\nLogin failed!"; Debug.Log("Login Failed"); return; } Debug.Log("Facebook Login succesful!"); res.text = txt; } catch (System.Exception e) { txt += e; Debug.LogError(e); } }
private void AuthCallback2(ILoginResult result) { if (FB.IsLoggedIn) { Logout.SetActive(true); // Player Logged in. Logout button should be displayed Login.SetActive(false); GetPlayerDetails(); } else { Debug.Log("User cancelled login"); if(Logout!=null) Logout.SetActive(false); // Player not Logged in. Logout button should be displayed if(Login!=null) Login.SetActive(true); } }
/// <summary> /// 登入回呼 /// </summary> /// <param name="result"></param> private void LoginCallback(ILoginResult result) { print("登入成功"); onLoginComplete.Invoke(); }
private void OnFacebookLogin(ILoginResult result) { FacebookManager.OnFacebookLoggedIn = null; FacebookManager.OnFacebookLogInFailed = null; base.Complete(); }
private Task <bool> Validate(string provider, ILoginResult token) { var p = GetProvider(provider); return(p.Validate(token)); }
void AuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { Debug.Log("FB login worked"); DealWithFBMenus(true); } else { Debug.Log("Fb login Fail"); DealWithFBMenus(false); } }
private void onLoginError(ILoginResult result) { toggleInteraction(isInteractable: true); string errorMessage = ""; if (result is ILoginCorruptionDetectedResult) { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Oops! Something went wrong. Please try again."); showGeneralError(errorMessage); MonoSingleton <NativeAccessibilityManager> .Instance.Native.HandleError(GeneralErrorText.GetInstanceID()); } else if (result is ILoginFailedAccountLockedOutResult) { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Acount.Login.Errors.LockedOut"); showGeneralError(errorMessage); MonoSingleton <NativeAccessibilityManager> .Instance.Native.HandleError(GeneralErrorText.GetInstanceID()); } else if (result is ILoginFailedAuthenticationResult) { showUsernameError(string.Empty); if (!isPinging) { toggleInteraction(isInteractable: false); isPinging = true; Service.Get <ConnectionManager>().DoPingCheck(delegate(ConnectionManager.NetworkConnectionState connectionState) { isPinging = false; toggleInteraction(isInteractable: true); if (connectionState == ConnectionManager.NetworkConnectionState.NoConnection) { Service.Get <PromptManager>().ShowError("GlobalUI.ErrorMessages.NetworkConnectionError", "GlobalUI.ErrorMessages.CheckNetworkConnection"); } else { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Acount.Login.Errors.InvalidCredentials"); showGeneralError(errorMessage); MonoSingleton <NativeAccessibilityManager> .Instance.Native.HandleError(GeneralErrorText.GetInstanceID()); onInvalidCredentialsError(errorMessage); } }); } } else if (result is ILoginFailedMultipleAccountsResult) { Service.Get <MixLoginCreateService>().OnMultipleAccountsResolutionSuccess += onSendSuccess; Service.Get <MixLoginCreateService>().MultipleAccountsResolutionSend(loginPayload.Username); Service.Get <PromptManager>().ShowError("Account.Login.Error.MultipleAccountsSameEmail", "Account.Login.Error.ResolveInstructionsEmailSent"); } else if (result is ILoginFailedGatedLocationResult) { Service.Get <PromptManager>().ShowError("GlobalUI.Homescreen.GeoGate.Title", "GlobalUI.Homescreen.GeoGate.Body"); } else if (result is ILoginFailedParentalConsentResult) { DPrompt data = new DPrompt("Acount.Login.Errors.ActivationNeeded", "Account.Login.Error.ActivationEmailResend", DPrompt.ButtonFlags.NO | DPrompt.ButtonFlags.YES); Service.Get <PromptManager>().ShowPrompt(data, resendActivationEmail); } else if (result is ILoginFailedProfileDisabledResult) { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Acount.Login.Errors.BanPermanent"); showGeneralError(errorMessage); MonoSingleton <NativeAccessibilityManager> .Instance.Native.HandleError(GeneralErrorText.GetInstanceID()); } else if (result is ILoginFailedTemporaryBanResult) { onTemporaryBanError(); } else if (result is ILoginMissingInfoResult) { if (string.IsNullOrEmpty(loginPayload.Username)) { errorMessage = string.Format(Service.Get <Localizer>().GetTokenTranslation("Account.Create.Validation.Empty"), Service.Get <Localizer>().GetTokenTranslation("Account.Create.Validation.UsernameField")); showUsernameError(errorMessage); } if (string.IsNullOrEmpty(loginPayload.Password)) { errorMessage = string.Format(Service.Get <Localizer>().GetTokenTranslation("Account.Create.Validation.Empty"), Service.Get <Localizer>().GetTokenTranslation("Account.Create.Validation.PasswordField")); showPasswordError(errorMessage); } onMissingInfoError(errorMessage); } else if (result is ILoginFailedRateLimitedResult || result is ILoginSecurityUpdateResult) { string type = ""; string format = "Account.General.Error.RateLimited"; Service.Get <EventDispatcher>().DispatchEvent(new ApplicationService.Error(type, format)); } else { errorMessage = Service.Get <Localizer>().GetTokenTranslation("Account.Create.Validation.UnknownError"); showGeneralError(errorMessage); MonoSingleton <NativeAccessibilityManager> .Instance.Native.HandleError(GeneralErrorText.GetInstanceID()); if (Service.Get <MixLoginCreateService>().RegistrationConfig == null || Service.Get <MixLoginCreateService>().RegistrationAgeBand == null || Service.Get <MixLoginCreateService>().UpdateAgeBand == null) { string step = ((Service.Get <MixLoginCreateService>().RegistrationConfig == null) ? "config" : "ageband"); string type = "Account.Create.Error.OneID.Title"; string format = "Account.Create.Error.OneID"; Service.Get <EventDispatcher>().DispatchEvent(new SessionErrorEvents.RegistrationConfigError(type, format, step)); } } loginController.OnLoginError -= onLoginError; }
private void onLoginFailed(ILoginResult result) { dispatchLoginError(result); }
public Task StoreToken(ILoginResult token) { return(_store.Store(typeof(GoogleLoginResult).FullName, token)); }
void LoginCallback(ILoginResult result) { Debug.Log("LoginCallback access token: " + Facebook.Unity.AccessToken.CurrentAccessToken.TokenString); if (FB.IsLoggedIn) { isLogin = true; OnLoggedIn(); loadingState = LoadingState.WAITING_FOR_INITIAL_PLAYER_DATA; getFriendLevels(); } }
// Update is called once per frame private AuthCallback(ILoginResult result) { if (FB.IsLoggedIn) { } }
private static string SummariseResult(ILoginResult r) { return(string.Join('|', r.IsSuccess ? "S" : "s", r.IsFatal ? "D" : "d", r.IsUserFault ? "U" : "u", r.Description)); }
protected void onLoginFailed(ILoginResult value) { this.OnLoginFailed.InvokeSafe(value); }
private void HandleOnLoginFailed(ILoginResult result) { Log.LogError(this, "Login Failed"); }
private void FBLoginCallback(ILoginResult result) { if(FB.IsLoggedIn) { // 로그인 됨 Debug.Log("SuccessFul Login"); // 페북 userid 저장 DataManager.fbUserid = AccessToken.CurrentAccessToken.UserId; UserManager.name = null; // 서버로 로그인 시도 ServerManager.m.Post_LoginResult += LoginWithFacebookResult; ServerManager.m.Post_LoginWithFacebook_f(DataManager.fbUserid); } else { Debug.Log("Login Denied"); } }
// 페이스북 로그인 콜백 private void LoginCallback(ILoginResult result) { if (FB.IsLoggedIn) { // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's User ID if (PlayerPrefs.HasKey("FaceBookKey")) { } else { Debug.Log("FaceBookKey : " + aToken.UserId); PlayerPrefs.SetString("FaceBookKey", aToken.UserId); } // 기존 페이스북을 연동한 계정이 존재하는지 if (nickNameUI.CheckDBFromFaceBook(PlayerPrefs.GetString("FaceBookKey").ToString())) { nickNameUI.ChangeActive(UIState.success, UIState.facebook); } else { if (!nickNameUI.CreateUserDB(PlayerPrefs.GetString("FaceBookKey").ToString())) { Debug.Log("Create DB Error"); } else { nickNameUI.ChangeActive(UIState.success, UIState.facebook); } } // Print current access token's granted permissions foreach (string perm in aToken.Permissions) { Debug.Log(perm); } } else { Debug.Log("User cancelled login"); } }
void HandleLoginResult (ILoginResult result) { if (result.Cancelled || !string.IsNullOrEmpty (result.Error)) { FacebookLoginCallbackEvent (result.Error, false); return; } FacebookLoginCallbackEvent (FacebookId(), true); }
private void HandleOfflineSessionResumed(IResumeSessionResult result, ISession session, ILoginResult loginResult, GuestApiErrorCollection gcErrorCollection, Action <ILoginResult> callback) { if (!result.Success) { callback(new LoginResult(success: false, null)); } else if (loginResult is ILoginMissingInfoResult) { callback(new LoginMissingInfoResult(success: true, session)); } else if (loginResult is ILoginSecurityUpdateResult) { callback(new LoginSecurityUpdateResult(success: true, session)); } else if (loginResult is ILoginRequiresLegalMarketingUpdateResult) { legalMarketingErrorsBuilder.BuildErrors(session, gcErrorCollection, delegate(BuildLegalMarketingErrorsResult response) { callback(new LoginRequiresLegalMarketingUpdateResult(success: true, session, response.LegalDocuments, response.Marketing)); }, delegate { callback(new LoginResult(success: false, null)); }); } else { callback(new LoginResult(success: true, session)); } }
void OnLoginCb (ILoginResult result) { if (result.Error != null) { DebugUtils.DebugLogError(result.Error); OnEventNotify(SNResultCode.kLoginFailed); } else if (!FB.IsLoggedIn) { DebugUtils.DebugLog("User cancelled login."); OnEventNotify(SNResultCode.kLoginFailed); } else { DebugUtils.DebugLog("Login successful!"); // AccessToken class will have session details var aToken = Facebook.Unity.AccessToken.CurrentAccessToken; // Print current access token's granted permissions StringBuilder perms = new StringBuilder(); perms.Append("Permissions: "); foreach (string perm in aToken.Permissions) perms.AppendFormat("\"{0}\", ", perm); DebugUtils.Log(perms.ToString()); // Reqests my info and profile picture FB.API("me?fields=id,name,picture.width(128).height(128)", HttpMethod.GET, OnMyProfileCb); OnEventNotify(SNResultCode.kLoggedIn); } }
private void HandleLoginSuccess(GuestControllerResult <LogInResponse> result, Action <ILoginResult> callback) { try { LogInResponse response = result.Response; LogInData data = response.data; GuestApiErrorCollection gcErrorCollection = response.error; ILoginResult loginResult = GuestControllerErrorParser.GetLoginResult(gcErrorCollection); bool flag = false; string hallPassToken = string.Empty; string swid = string.Empty; if (data != null || loginResult == null) { goto IL_015d; } if (loginResult is ILoginFailedParentalConsentResult) { foreach (GuestApiError error in gcErrorCollection.errors) { TemporaryToken data2 = error.data; if (data2 != null) { flag = true; hallPassToken = data2.accessToken; swid = data2.swid; break; } } if (flag) { goto IL_015d; } callback(loginResult); } else { callback(loginResult); } goto end_IL_0018; IL_015d: if (data == null && !flag) { if (gcErrorCollection != null) { logger.Critical("Received unhandled error exception: " + JsonParser.ToJson(gcErrorCollection)); } callback(new LoginResult(success: false, null)); } else if (flag) { database.StoreSession(swid, hallPassToken, null, null, null, null, null, null, null, null, updateLastProfileRefreshTime: false, null); IGuestControllerClient guestControllerClient = guestControllerClientFactory.Create(swid); ProfileGetter.GetProfile(logger, guestControllerClient, delegate(ProfileData profileData) { if (profileData == null) { database.DeleteSession(swid); callback(new LoginFailedParentalConsentResult()); } else { StoreSession(swid, hallPassToken, null, profileData.etag, profileData.displayName, profileData.profile); HandleRefreshProfileSuccess(callback, loginResult, gcErrorCollection, profileData.profile, profileData.displayName, profileData.marketing, swid, hallPassToken); } }); } else if (!ValidateLogInData(data)) { logger.Critical("Error parsing the login data:" + JsonParser.ToJson(data)); callback(new LoginResult(success: false, null)); } else { Token token = data.token; StoreSession(token.swid, token.access_token, token.refresh_token, data.etag, data.displayName, data.profile); HandleRefreshProfileSuccess(callback, loginResult, gcErrorCollection, data.profile, data.displayName, data.marketing, token.swid, token.access_token); } end_IL_0018 :; } catch (CorruptionException arg) { logger.Fatal("Corruption detected during login: "******"Unhandled exception: " + arg2); callback(new LoginResult(success: false, null)); } }
private void LoginCallback(ILoginResult result) { FB_LoginResult res; if (result == null) { res = new FB_LoginResult(string.Empty, "Null Response", false); } else { res = new FB_LoginResult(result.RawResult, result.Error, result.Cancelled); } if(res.IsSucceeded && !result.Cancelled && result.AccessToken != null) { _UserId = result.AccessToken.UserId; _AccessToken = result.AccessToken.TokenString; res.SetCredential(_UserId, _AccessToken); } SPFacebook.Instance.LoginCallback(res); }
public void LoginCallback(ILoginResult result) { if(FB.IsLoggedIn){ this.loginCallback(); } }