I have this code here:
private Texture profilePic;
public Texture GetProfilePic()
{
FB.API("me/picture?width=100&height=100", HttpMethod.GET, ProfilePicCallback);
return profilePic;
}
private void ProfilePicCallback(IGraphResult result)
{
if (result.Error != null || !FB.IsLoggedIn)
{
Debug.LogError(result.Error);
}
else
{
Debug.Log("FB: Successfully retrieved profile picture!");
profilePic = result.Texture;
}
}
Yet somehow, when I call the GetProfilePic
function, it returns null even though the "success" message was printed in the console. I have properly set up the Facebook ID and whatnot, so it can't be that. What is happening here, and how can I fix this?