FQL is_app_user is not working anymore - facebook

I have a few Facebook apps, and I use the following FQL to get the list of app users:
SELECT uid,name FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1
and it works fine, but now I created a new app, and the above FQL always returns empty and I know for a fact that I have friends using the APP,
Any ideas?

The problem was solved by adding "user_friends" to the list of requested permissions, I didn't need this permission in Graph API V1.0

Related

Facebook FQL limited friends issue

I am using facebook FQL to get the friends list
I am using this query
"select uid, name, pic_square, is_app_user from user where uid in (select uid2 from friend where uid1 = me())";SELECT uid, name, is_app_user, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1"
Its working fine but it returns me only few friends like 15 to 20
I need all my friends in responce
Any idae?
Thanks
I guess you're using v2.0 of the Graph API. Therefore, you only get the friends which also use the app of which the requesting user access token was issued
See https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids
If your app was set up before April 30th 2014, you can specify that you explicitly want to use v1.0, which will give you all friends. This will only work until April 30th, 2015. If the app was created later, there's no possibility to get all friends.

Show friends on application

I have a FB app. I need to have a functionality similar to which is present on Washington post reader that shows friends on the app.
Is it FB facepile? If so, then how have they implemented to show more than 4 friends with a button? Have they implemented it server side ?
You can use FQL to retrieve friends using the same app.
Simply use the query below and you should be able to get frineds' uid, name and is_app_user.
*is_app_user* indicates if a given user is using your app or not.
select uid, name, is_app_user from user where uid in (select uid2 from
friend where uid1=me()) and is_app_user=1

Get only married friends using Graph API

Is there a way to get friends with relationship_status equals Married using Graph API?
I did it using FQL, but some fields aren't equals and I have problems using RestFB with these fields like birthday which have different behaviors using Graph API and FQL.
FQL code do get married friends
SELECT uid, name, relationship_status FROM user WHERE (uid = MY_ID OR uid IN (SELECT uid2 FROM friend WHERE uid1 = MY_ID)) AND relationship_status='Married'
I wanna to do the same with Graph API
Graph API is more clean I think too.
Thanks
You have the exact query to get all married friends.
Just you have to do is call this FQL query using GRAPH API.
See the following blog for more details on how to call an FQL using GRAPH API.
http://developers.facebook.com/blog/post/579/
Also please read my answer to this question to just to fix any possible errors when using 'file_get_contents' in your code (as in the example of the FB blog post)
try this..
https://graph.facebook.com/fql?q=SELECT uid, name, relationship_status FROM user WHERE (uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())) AND relationship_status='Married'.

Getting friends using the same application on Facebook

I'm using play framework to create a facebook application. I'm kinda stucked at some point. With Graph Api i can't take a list of friends who use my application. What i want to say is for example:
A is using my application.
B is using my application too and B is a friend of A.
When A is using my application, I want A to see B is also using this application.
Simply I want to get list of friends using same application.
How would i do that with Graph Api?
There is a field called "is_app_user" on the user table that you could run a FQL query against. The query would be something like:
select uid, name
from user
where is_app_user = 1
and uid in (SELECT uid2 FROM friend WHERE uid1 = me())
The graph url for that would be like this (remember to add an access token):
https://api.facebook.com/method/fql.query?query=select uid, name from user where is_app_user = 1 and uid in (SELECT uid2 FROM friend WHERE uid1 = me())&access_token=...
With Friend A's access token do a Post to me/friends to get the list of friends. See if Friend B is on the list. See: http://developers.facebook.com/docs/reference/api/user/

facebook fql query to retrieve friends posted items

Is there any fql statements allowed by facebook that helps to fetch contents of this page through an application interface: http://www.facebook.com/posted.php I know the links table returns the posted item for a logged in user (http://developers.facebook.com/docs/reference/fql/links). I need the same but for the logged-in user's friends.
Thanks.
you can use Fql query or Graph API to get your friends data.
Sometimes you will not get all information from the graph like birthdate of your friends but yes you can use fql queries to solve your probs.
here is an exmple for you.
create first facbook object and the use it.
$query = "SELECT uid, first_name, last_name, birthday_date, sex, pic_square, current_location, hometown_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND birthday_date != 0 ORDER BY birthday_date";
Regards,
Archit.
You can do this through an FQL query - though you may need to use multiple queries if you require more information about the friend who posted the link:
select title, owner from link where owner in (select uid2 from friend where uid1 = me() limit 100)
You may want to limit the number of friends (or even the links themselves) as this can be a costly query