facebook friends status - iphone

i am using this fql query but not getting status its showing null in status for getting facebook friends message please help
SELECT uid, pic_square, name, status FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 100000660426865)

The query you have built attempts to access your local host SQL server.
Would you like to get status from Facebook directly?
If so, you API provided by Facebook instead.

Related

Facebook FQL not working under application

I have a FQL(Facebook) query running to get all the movies list from my friends.
Query :
"SELECT uid,name,movies FROM user where uid IN (SELECT uid2 FROM friend WHERE uid1 = me())"
I have tested the application under Graph API Explorer ,its working but when i shift query to my application it doesn't work.
I have Enabled the permissions also , namely user_about_me, friends_about_me, friends_likes, user_likes , user_interests ,friends_interests.
Added Extended Permission : read_stream , read_requests.
Can anybody help in this !!

Get Facebook application subscribers

Let's suppose I have a Facebook application with ID: XXXXXX
Is there a way to get its subscribers who are already in my friends list?
You can do this with an FQL query like this:
SELECT name, uid FROM user WHERE
uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
AND is_app_user = 1
You can only get this information from a user who is currently authenticated with your app.

How can I get only the users (friends) who are using my app?

I have a PhoneGap app, where I need to list all the user's friends, who have authorized the application on Facebook.
I'm currently using FB.api('/me/friends?fields=installed', callbackFnc), but this shows me all friends, pointing which of them have authorized the app. When I really wanted to list only the authorized ones.
This slows a lot the process of loading friends.
I saw other similar questions here, but none of them had the answer.
SOLUTION: Thanks to CBroe
I couldn't have sucess passing the FQL directly to FB.api, but only using that object:
var apiQuery =
{
method: 'fql.query',
query: 'SELECT uid, name FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2 = me() ) AND is_app_user'
}
FB.api(apiQuery, function(response){...});
Use FQL instead:
SELECT uid, name FROM user WHERE uid IN
(SELECT uid1 FROM friend WHERE uid2 = me() ) AND is_app_user
(You can set up that query against the Graph API as well, /fql?q={query}.)

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())
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.
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.
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)
SELECT uid FROM user WHERE uid IN ( SELECT uid2 FROM friend
WHERE uid1 = '549483876' ) AND is_app_user = 1

Get friend's gender in a Facebook application

While developing a Facebook application I got the friendlist of a user by
$friends = $facebook->api('/me/friends');
But I only got to know the name and Facebook Ids of the friends : http://developers.facebook.com/docs/reference/api/FriendList
Is there any way to get the gender of a friend?
One way to do so is to get the user's gender (since it is publicly available) given the user's facebook Id (which I have got using the friend list)
Is it really possible to do the above thing.
If not is there any other way?
for reference : http://developers.facebook.com/docs/reference/api/user
A quick way with Graph API
$facebook->api('me/friends?fields=id,name,gender,installed&access_token=[ACCESS_TOKEN]");
http://developers.facebook.com/docs/reference/api/FriendList = a persons fiend lists (plural) - eg: Limited Profile
What you want to do is get the ID from graph.facebook.com/me/firends and then do a graph.facebook.com/ID for the gender. But of course that ends up being a lot of requests if you need it for all of their friends.
For those cases you can use FQL query: http://developers.facebook.com/docs/reference/fql/
You can adopt following query from their documentation:
SELECT uid, name, pic_square FROM user WHERE uid = me() OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
Here name and gender of the current users friends:
SELECT uid, name, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())