Hello,
My name is Prasanth. I'm using Playfab plugin for managing leaderboards(both global and facebook). I'm using Loginwithfacebook function to login my players via facebook. The problem now is i want profile picture of my friends in facebook leaderboards. So what I'm doing is i'm getting list of playfab id from GetFriendLeaderboardAroundCurrentUser() method and storing it in a list.
So inorder to get facebook id from playfab id i'm using the following method:
//Current ID number is incrementing value where it increments when the first id has been successfully retrieved.
GetAccountInfo(PlayFabID[CurrentIdNumber]); //PlayFabID[] is a list
void GetAccountInfo(string playfabID)
{
Debug.Log("PlayFabID " + playfabID);
GetAccountInfoRequest userinforequest = new GetAccountInfoRequest()
{
PlayFabId = playfabID
};
PlayFabClientAPI.GetAccountInfo(userinforequest, accountinforesult, OnApiCallError);
}
void accountinforesult(GetAccountInfoResult result)
{
Debug.Log("facebookID" + result.AccountInfo.FacebookInfo.FacebookId);
FacebookString = result.AccountInfo.FacebookInfo.FacebookId;
FacebookID.Add(FacebookString);
FB.API("/" + FacebookString + "/picture", HttpMethod.GET, ApplyProfilePicture);
}
Note that i'm using FacebookString as retrieved facebook id into FB.API to get the facebook profile picture.
The error i'm getting is:
HTTP:200
ERROR:Unknown -- System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
at FacebookLeaderboard.accountinforesult
Any suggestions on how to fix this error and retrieve the profile picture with ease. And what is the best way to retrieve multiple account picture of the users(maximum 10)?
Thank You.