iphone - 用于获取用户的 Facebook 好友性别以及 meet_sex 的 FQL 查询

标签 iphone objective-c facebook-graph-api facebook-fql fbrequest-form

并不像听起来那么活泼 - 我使用下面的代码来仅获取用户的男性或女性 friend ,并且效果很好。但是,我还想检查他们的“meeting_sex”,这是用户 friend 有兴趣见面的性别列表,即男性、女性或两者兼而有之。 (描述 here )

meeting_sex 需要 Friends_relationship_details 权限,我已将其添加到图形 API 资源管理器中,但我的输出如下所示:

"data": [
{
  "name": "ABCDEF", 
  "pic_square": "https://abcdefg.jpg", 
  "sex": "male", 
  "meeting_sex": null, 
  "uid": 123456789
}, 

即Meeting_sex 返回为空。我知道 Meeting_sex 是一个数组,而不仅仅是一个字符串,其他元素也是如此,但为什么它返回 null?

我是 FQL 新手,实际上是任何 QL 新手,所以一旦我正确读取数组,我该如何进行比较?也就是说,我只返回喜欢 WOMEN 的 MEN 或喜欢 MEN 的 MEN 等。这是我当前的代码:

NSString *queryString =  [NSString stringWithFormat:@"SELECT name, pic_square, sex, meeting_sex, uid FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND sex = 'male' ORDER BY name"];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys: queryString, @"query", nil];

[FBRequest getRequestWithParams:dictionary
                     httpMethod:@"GET" 
                       delegate:self
                     requestURL:@"fql.query"];

感谢您的帮助:)

迈克尔

最佳答案

我已经在我的帐户上尝试过此操作,但除了我的一位 friend 之外,所有其他人都得到了空值。他们的 meet_for 和 meet_sex 都有一个空数组

我发现有些人建议不再使用它:

http://forum.developers.facebook.net/viewtopic.php?id=103173

此外,这似乎存在很多隐私问题:

参见https://www.facebook.com/settings/?tab=privacy点击“应用和网站”,然后点击“人们如何将您的信息引入他们使用的应用”

同样来自 https://developers.facebook.com/docs/reference/rest/users.getInfo/

User Privacy and Visible Data

Important: Depending upon the user's privacy settings (including whether the user has decided to opt out of Platform completely), you may not see certain user data. For any user submitted to this method, the following user fields are visible to an application only if that user has authorized that application and specifically chose to reveal them:

    meeting_for
    meeting_sex
    religion

编辑

Graph API 用户 (https://developers.facebook.com/docs/reference/api/user/) 对象中的新增内容:

interested_in The genders the user is interested in. user_relationship_details or friends_relationship_details. array containing strings.

关于iphone - 用于获取用户的 Facebook 好友性别以及 meet_sex 的 FQL 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8607032/

相关文章:

iphone - 在 iPhone 上与手机互动

iphone - 为armv6和armv7构建iPhone静态库,其中包括另一个静态库

iphone - 在 objective-c 中, "2011-05-10T14:30:00 0000"的正确日期格式是什么?

ios - OCMock 抛出 EXC_BAD_ACCESS

iphone - 发布时您为什么 iPhone 操作系统构建?

ios - 在 swift3 中结合平移、alpha 和缩放动画

iphone - 移除或重新激活 uivew 层上的 CABasicAnimation

android - 通过图形 API 将评论发布到社交插件框

jquery-ui - 使用 Jquery 动态生成时,Facebook 标签不会呈现

javascript - 如何在 facebook 中建立按钮注册?