[英]Facebook SDK Unity me/friends v2.2 returns 0
I have issue with getting friends id, name and picture, I have FB.API at Start and deserialize results at own method. 我在获取朋友ID,名称和图片时遇到问题,我在开始时使用FB.API,并以自己的方法反序列化结果。 I am using test users from Facebook Developers page.
我正在使用来自Facebook开发人员页面的测试用户。
Here is Start() code 这是Start()代码
FB.API("/me/friends", Facebook.HttpMethod.GET, DealWithFriendName);
Here is code to deserialize it so I can get id out of it. 这是反序列化的代码,因此我可以从中获取ID。 Havent yet coded to get name or picture
Havent尚未编码以获取名称或图片
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. 即使我创建了3个测试用户并且他们是彼此的朋友,朋友列表计数也为0。
I am clueless what to try anymore. 我无能为力了。
This is the like 1000th question for this topic. 这是该主题的第1000个问题。 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.
在Graph API v2.0中,对/ me / friends的访问不再是默认(public_profile)权限的一部分。 We now require you to ask for the new permission user_friends.
现在,我们要求您请求新的权限user_friends。 With this permission, /me/friends now returns the person's friends who are also using the app.
有了此许可,/ me / friends现在可以返回也在使用该应用程序的用户的朋友。
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.
默认选项是不安装它们,这意味着当您查询好友API时,您将获得Facebook API v2.x上提到的@Tobi行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.