Reputation: 11
I have issue with getting friends id, name and picture, I have FB.API at Start and deserialize results at own method. I am using test users from Facebook Developers page.
Here is Start() code
FB.API("/me/friends", Facebook.HttpMethod.GET, DealWithFriendName);
Here is code to deserialize it so I can get id out of it. Havent yet coded to get name or picture
void DealWithFriendName(FBResult result)
{
if (result.Error != null)
{
Debug.Log("Problem with getting user data");
FB.API("/me/friends", Facebook.HttpMethod.GET, DealWithFriendName);
return;
}
Friends = Util.DeserializeJSONFriends(result.Text);
foreach (object id in Friends)
{
var entry = (Dictionary<string, object>)id;
}
Debug.Log(Friends.Count);
for(int i=0;i < Friends.Count;i++)
{
Debug.Log(Friends[i]);
}
}
Friend List count is 0 even if I have created 3 test users and they are friends with each other.
I am clueless what to try anymore.
Upvotes: 1
Views: 1872
Reputation: 619
Creating test accounts does not automatically associate them with your app. The default option is to have them not installed, which means when you query the friends API you will get the behavior @Tobi mentioned on Facebook API v2.x.
Upvotes: 1
Reputation: 31479
This is the like 1000th question for this topic. You only can get those friends which also use your app:
In Graph API v2.0, access to /me/friends is no longer part of the default (public_profile) permissions. We now require you to ask for the new permission user_friends. With this permission, /me/friends now returns the person's friends who are also using the app.
Upvotes: 0