获取好友列表并了解他们是否安装了我的应用 [英] getting the list of friends and to know if they have my app installed or not

查看:25
本文介绍了获取好友列表并了解他们是否安装了我的应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Eclipse FDT 在 facebook 页面上为 facebook 编写 Flex 应用程序.我希望能够获取同一用户的好友列表,并区分安装了该应用的好友和未安装该应用的好友.

I'm using Eclipse FDT to write a Flex application for facebook on a facebook page. I want to be able to fetch the friends list of that same user and to distinguish between friends who installed the app and friends who didn't.

我在 stackoverflow 上搜索,我看到用户使用旧的 REST API 做到了这一点,问题是我可以使用图形 API 做到这一点吗?

I searched on stackoverflow and I saw that users did that using the old REST API, the question is can I do that with graph api ?

如果根本无法使用图形 API...那么如何使用 REST API 呢?!:)

if it's not possible using graph api at all... so how to do with REST API ?! :)

具有以下请求:

https://graph.facebook.com/me/friends?access_token?XXX

我可以获取该用户的好友列表.但如果我的应用程序已安装,它不会提供标志.我到底能做什么,怎么做?!

I can fetch the list of friends of that user. but it doesn't provide a flag if my app is installed. what can I do exactly and how ?!

谢谢!

推荐答案

您有两种方法可以做到,使用图形 api 和使用 fql.

You have two ways to do it, with the graph api and with fql.

使用graph api,您可以向:/me/friends?fields=installed 应该返回一个用户列表,安装了该应用程序的用户将具有以下形式:

Using the graph api you can make a request to: /me/friends?fields=installed which should return a list of users, the ones that have the app installed will have this form:

{
    "installed": true, 
    "id": "USER_ID"
}

没有应用程序的人将采用这种形式:

The ones who don't have the app will be of this form:

{
    "id": "USER_ID"
}

使用 FQL 使用 这个查询:

SELECT 
    uid
FROM 
    user 
WHERE 
    is_app_user 
    AND 
    uid IN (SELECT uid2 FROM friend WHERE uid1 = me())

这篇关于获取好友列表并了解他们是否安装了我的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆