/// <summary> /// 2. 로그인 /// </summary> void Check_Login() { //구글에 로그인 안됐을때 //그냥 로그인 안됏을때 if (BackEndAuthManager.Get_Join_User()) { if (BackEndAuthManager.Get_User_Type()) { //게스트 로그인 BackEndAuthManager.GoogleFireBaseLogin(); } else { //구글 로그인 Debug.Log("로그인 되있음"); SocalManager.Login(); } } else { Debug.Log("로그인 안되있음"); PopupManager.Open_Popup(LoginPopup); } }
private void Awake() { instance = this; Find_Obj(); AddListener(); BackEndAuthManager.Init(); SocalManager.Init(); }
private void AddListener() { toggle_Service.onValueChanged.AddListener((bool ison) => Check_Toggle()); btn_Service.onClick.AddListener(() => Application.OpenURL(" https://sites.google.com/site/breaktieme/terms-of-service")); toggle_Privacy.onValueChanged.AddListener((bool ison) => Check_Toggle()); btn_Privacy.onClick.AddListener(() => Application.OpenURL("https://sites.google.com/site/breaktieme/privacy-policy_kr")); btn_Service_Ok.onClick.AddListener(() => Open_Login()); btn_Google.onClick.AddListener(() => SocalManager.Login()); btn_Guest.onClick.AddListener(() => BackEndAuthManager.GoogleFireAnonymousLogin()); btn_Next.onClick.AddListener(() => Main_Scene()); logout.onClick.AddListener(() => BackEndAuthManager.Firebase_Logout()); }
/// <summary> /// 구글 로그인 /// </summary> public static void GoogleFireBaseLogin() { PopupManager.Close_Popup(); if (auth.CurrentUser == null) { Debug.Log("로그인 안 되어 있음"); Firebase.Auth.Credential credential = Firebase.Auth.GoogleAuthProvider.GetCredential(SocalManager.GetTokens(), null); auth.SignInWithCredentialAsync(credential).ContinueWith(task => { if (task.IsCanceled) { return; } if (task.IsFaulted) { return; } user_id = auth.CurrentUser.UserId; BackEndDataManager.instance.Get_First_Data(); }); } else { //Set_State("로그인 되어 있음 " + auth.CurrentUser.UserId); Debug.Log("로그인 되어 있음 " + auth.CurrentUser.DisplayName + " \n " + auth.CurrentUser.Email + " \n " + auth.CurrentUser.IsAnonymous + " \n " + auth.CurrentUser.IsEmailVerified + " \n " + auth.CurrentUser.ProviderId + " \n " + auth.CurrentUser.UserId + " \n "); user_id = auth.CurrentUser.UserId; BackEndDataManager.instance.Get_First_Data(); } }
public void GetTokens() { Debug.Log(SocalManager.GetTokens()); }