Esempio n. 1
0
    public void click_SignOut()
    {
        SOUND.I.Play(DEF.SND.common_click);
        try
        {
            FB.LogOut();
            PlayerPrefs.DeleteAll();
        }
        catch (System.Exception)
        {
        }

        PlayerPrefHelper.SetLoginType(eLoginType.none);
        SCENE.I.AddMessage(SCENEIDs.GameToLobby);
        SCENE.I.AddMessage(SCENEIDs.FBSignOut);
        Close("x");
    }
Esempio n. 2
0
    /// <summary>
    /// 페이스북 로그인을 성공하면 페이스북을 통하여 사용자 정보를 받아온다.
    /// </summary>
    public void LoadUserInfo(OnUserInfoCallback complete)
    {
        FB.API("me?fields=id,name,email,picture.width(300),first_name,gender,last_name,locale,timezone", HttpMethod.GET, (result) =>
        {
            if (result == null)
            {
                if (complete != null)
                {
                    complete(false);
                }
                return;
            }

            if (!string.IsNullOrEmpty(result.Error))
            {
                Debug.Log("## FBController : CallbackUserInfo >> Error = " + result.Error);
                //UI.Popup.ShowNoticeBox("FB User Info : " + result.Error, null);
                if (complete != null)
                {
                    complete(false);
                }
            }
            else if (result.Cancelled)
            {
                Debug.Log("## FBController : CallbackUserInfo >> Cancelled = " + result.Cancelled);
                //UI.Popup.ShowNoticeBox("FB User Info : Cancelled", null);
                if (complete != null)
                {
                    complete(false);
                }
            }
            else if (!string.IsNullOrEmpty(result.RawResult))
            {
#if UNITY_EDITOR
                PlayerPrefHelper.SetFBLoginResult(result.RawResult);
#endif
                SetFBLoginInfo(result.RawResult);
                PlayerPrefHelper.SetLoginType(eLoginType.facebook);
                if (complete != null)
                {
                    complete(true);
                }
            }
        });
    }