/// <summary> /// Run sequence to load user profile, apprequest, friends profiles, invitable friends profiles /// </summary> private void LoadAllFBData() { fbState = FBState.LoadData; TweenSeq tS = new TweenSeq(); tS.Add((callBack) => { GetPlayerTextInfo(callBack); }); tS.Add((callBack) => { GetPlayerPhoto(callBack); }); tS.Add((callBack) => { fbState = FBState.Free; if (callBack != null) { callBack(); } }); tS.Start(); }
void OnLogin() { Debug.Log("Login was successful!"); CallFBPublishInstall(); State = FBState.Share; _FBSprite.spriteName = _FBShare; }
void Awake() { FBButton.Clicked += HandleClicked; if(GoogleButton != null) GoogleButton.Clicked += HandleGoogleButtonClicked; FB.Init(OnInitComplete, OnHideUnity); _FBSprite = GetComponent<UISprite>(); State = FBState.Login; CallFBFeed(); }
void Awake() { FBButton.Clicked += HandleClicked; if (GoogleButton != null) { GoogleButton.Clicked += HandleGoogleButtonClicked; } FB.Init(OnInitComplete, OnHideUnity); _FBSprite = GetComponent <UISprite>(); State = FBState.Login; CallFBFeed(); }
public void FBlogin() { if (debugLogin) { Debug.Log("Try facebook login"); } if (Application.internetReachability == NetworkReachability.NotReachable) { if (debugLogin) { Debug.Log("Error. Check internet connection!"); } return; } fbState = FBState.Login; permissions = new List <string>(); permissions.Add("public_profile"); permissions.Add("email"); permissions.Add("user_friends"); // required appreview FB.LogInWithReadPermissions(permissions, (result) => { fbState = FBState.Free; if (FB.IsLoggedIn) { playerID = null; playerFirstName = null; playerLastName = null; playerPhoto = null; if (debugLogin) { Debug.Log("facebook is logged in, app token :" + AccessToken.CurrentAccessToken.TokenString); } LastSessionLogined = true; LoadAllFBData(); } else { if (debugLogin) { Debug.Log("facebook is not logged in, loginTryCount : " + loginTryCount); } if (result.Error != null) { Debug.Log(result.Error); } if (!result.Cancelled) { if (loginTryCount-- > 0) { FBlogin(); // try next login } else { loginTryCount = 10; } } else { if (debugLogin) { Debug.Log("Login cancelled"); } } } if (LoginEvent != null) { LoginEvent(IsLogined, result.Error); } }); }
void OnLogin() { Debug.Log( "Login was successful!" ); CallFBPublishInstall(); State = FBState.Share; _FBSprite.spriteName = _FBShare; }