private void ParseUserData(IDictionary <string, object> data) { try{ _userInfo = new FB_UserInfo(data); StartCoroutine("LoadProfileTexture"); } catch (Exception e) { Debug.LogWarning("Parceing User Data failed"); Debug.LogWarning(e.Message); OnFacebookProfileLoadResult(false); } }
//-------------------------------------- // Internal Event Handlets //-------------------------------------- private void UserDataCallBack(FB_Result result) { if (result.IsFailed) { Debug.LogWarning(result.Error); } else { Debug.Log("[UserDataCallBack] result.RawData " + result.RawData); _userInfo = new FB_UserInfo(result.RawData); } OnUserDataRequestCompleteAction(result); }
private void OnUserDataLoaded(FB_Result result) { SPFacebook.OnUserDataRequestCompleteAction -= OnUserDataLoaded; if (result.IsSucceeded) { SA_StatusBar.text = "User data loaded"; IsUserInfoLoaded = true; myInfo = SPFacebook.instance.userInfo; Debug.Log("Email = " + myInfo.Email); Debug.Log(myInfo.ProfileUrl); if (PostLogin != null) { PostLogin("OK"); } } else { OnUserDataLoadFailed(); } }
private void ParseFriendsFromJson(string data, Dictionary <string, FB_UserInfo> friends, bool invitable = false) { Debug.Log("ParceFriendsData"); Debug.Log(data); try { friends.Clear(); IDictionary JSON = ANMiniJSON.Json.Deserialize(data) as IDictionary; IDictionary f = invitable ? JSON["invitable_friends"] as IDictionary : JSON["friends"] as IDictionary; IList flist = f["data"] as IList; for (int i = 0; i < flist.Count; i++) { FB_UserInfo user = new FB_UserInfo(flist[i] as IDictionary); friends.Add(user.Id, user); } } catch (System.Exception ex) { Debug.LogWarning("Parceing Friends Data failed"); Debug.LogWarning(ex.Message); } }