Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get list of facebook users who are using specific application using FQL

I am trying to fetch following case using FQL

If few users have authorized "Application A" then is it possible to know that currently how many users are using that "Application A" ( users those are not friends of each other)

So far i tried following FQL , but following query gives only information of those users who are friends of each other and using the same application , but what about other users who are not friends ?

SELECT uid, name, pic_square 
FROM user  
WHERE is_app_user=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
like image 949
Hunt Avatar asked Jan 31 '12 14:01

Hunt


3 Answers

You can't get a listing of your application's users from the API. If you need this, you should maintain your own database of users and reference that.

You can also check if any particular user is a user of your application by requesting /USER_ID/permissions?fields=installed with your application access token.

You can also check if a user's friends are users of your application by requesting the same field on the friends connection (for example, /USER_ID/friends?fields=installed). In this case, the USER_ID must be a user of your application or you won't be able to access their friends list.

like image 57
Igy Avatar answered Nov 08 '22 22:11

Igy


is_app_user on the user table when requesting friends returns this data.

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

or...

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

Which is a bit tighter - only returning those users in-app.

like image 23
humanity Avatar answered Nov 08 '22 21:11

humanity


You can't get total number of users who have installed application, but you can get daily, weekly and monthly users with simple query:

SELECT daily_active_users, weekly_active_users, monthly_active_users
  FROM application WHERE app_id = APPLICATION_ID

Note: this will work for any application (not just applications user connected to)

like image 3
Juicy Scripter Avatar answered Nov 08 '22 21:11

Juicy Scripter