简体   繁体   English

Facebook SDK Unity我/朋友v2.2返回0

[英]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.

相关问题 facebook v2.2登录C# - facebook v2.2 login C# unity3d facebook 1.7 sdk设备上没有朋友 - unity3d facebook 1.7 sdk no friends in device facebook sdk邀请朋友申请 - facebook sdk invite friends to application Web api v2.2和OData v4缺少EntitySetController类 - class EntitySetController missing with web api v2.2 and OData v4 奇怪的行为表达<Func>在 EfCore HasQueryFilter 方法 v2.2 中(重构问题) - weird behavior Expression<Func> in EfCore HasQueryFilter method v2.2 (Refactoring problem) Facebook Unity SDK自动登录? - Facebook Unity SDK AutoLogin? 使用声纳扫描仪msbuild v2.2在sonarqube 5.6.5中进行C#Project(在Msbuild v12中构建)代码分析 - C# Project(build in Msbuild v12) code analysis in sonarqube 5.6.5 using sonar scanner msbuild v2.2 Facebook SDK C# - 获取好友列表 - Facebook SDK C# - get friends list 获取我和我的朋友的帖子(Wall Facebook) - Get Posts (Wall Facebook) of me and my friends Project xxx与netcoreapp2.2(.NETCoreApp,Version = v2.2)不兼容。 Project xxx支持:net48(.NETFramework,Version = v4.8) - Project xxx is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2). Project xxx supports: net48 (.NETFramework,Version=v4.8)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM