Facebook query language. Get all user live in california - facebook

I am working in facebook Application MVC 4 c# SDK 6
is there any way to get the list of all Facebook User. Either friend or not, who lives in California using Facebook Query Language

List of your friends who live in California and have it list in their current location.
SELECT name, current_location
FROM User
WHERE uid IN (SELECT uid2 FROM Friend WHERE uid1 = me())
AND current_location.state = "California"
Test out the query here.
I don't think it's possible to pull this information on all Facebook users since the location column is not indexed. This answer does a good job explaining why searching by location along is not possible.
Helpful links:
how to write an fql query to list friends in a particular location
From FQL we want to get users current location in php

The one word answer is No. But you can get access to users that have made their location public.
see similar question Facebook API: can I get detailed info about user's location?

Related

Get friend list from facebook who downloaded the app in android using parse

I am developing the app which is login through the facebook account using link
and use the parse to store data in backend Parse Facebook Example
My requirement for this app is to get Facebook Friend List who downloaded this app on there phone ...
I am getting the the Friend List but I still don't know how to get the who downloaded this app from my friends...
I am getting the friends facebook Id but It didn't get the user other profile information like name
Could anyone tell me how to get this...
Thanks.
You need to let people be able to "connect" their facebook account with your app. When they do, store their facebook id in your User table. Then you can get a person's friends list and then query your Parse database to see if any of those user IDs match people who have stored their facebook ID.
For more info, check this answer: Replicating parse.com anypic in JavaScript - Unable to compare Fb users
You can use the FQL query to get the friends who are using the app-
SELECT uid FROM user WHERE is_app_user=1 AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
Demo: https://developers.facebook.com/tools/explorer?fql=SELECT%20uid%20FROM%20user%20WHERE%20is_app_user%3D1%20AND%20uid%20IN%20(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20%3D%20me())

fql not working

I have used a fql for get my friends information
SELECT uid,name,first_name,middle_name,last_name,pic_square,hometown_location,current_location,profile_url,email,website FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
it returning only friends id an name. Who have trusted my app there location also comming but when I am puting this fql on the Graph API Explorer
on facebook then it returns every one's location. Then How Can I get every one's location ?
It is hard to understand your question, though it looks like your app doesn't have all the required user permissions. The Graph API explorer, or the developer page are great resources to figure out which ones you need.
Hometown location,current location, email, and website are not "basic" data.

Some facebook friends' birthdays returning as null but I have the correct API permissions

I'm tring to get my friends' birthdays in my app and some of them are null. I thought that those people don't have a birthday set, but they actually do.
My fql query is:
SELECT uid,name,birthday_date FROM user WHERE uid IN (SELECT uid2 from friend where uid1=me())
The birthdays are also null when I request /me/friends?fields=birthday
My access token has the friends_birthday permission set.
I also tried with birthday instead of birthday_date in the FQL query. Same result.
I imagine that this happens because they opted out somehow, but I don't know how.
Is there an alternate solution to actually get their birthdays from facebook?
It's also possible to remove the ability of apps to access your data when your friends use them, this option will prevent the current session user from seeing some information about their friends via the API, even if that information is accessible on Facebook.com
This setting is in the privacy settings, at https://www.facebook.com/settings/?tab=privacy, under Ads, Apps and Websites -> 'How people bring your info to apps they use' and looks like this:
{edit} you can test this for yourself with test users, it's the most likely reason assuming the birthdays are visible to you in the frontend
These people might have set their Birthdays visible to only themselves or only some restricted friends. This is an option available if we try to edit our Birthday by its side. That can cause it is not available to your query by app.

How can I determine which friends of the currently logged in user are also using my app?

The Graph API makes it easy for me to determine who the friends of the current user are. I have two questions:
Is it possible, using the Graph API, to determine the list of users for the currently authenticated application?
Is it possible to determine the friends of the current user who are also users of my application (the intersection of my app's users and the current user's friends)? Is this possible using FQL?
No, This is not possible. Refer to this answer.
There's a rest method called friends.getAppUsers for this. Or you could use FQL:
SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) AND is_app_user=1

Friends of Friends/2nd degree friend's list. Facebook Graph API

I am trying to get a list of my friend's friends using the iPhone Facebook SDK.
I've tried an approach using FQL and the Graph API but I get an error in both cases:
"Can't lookup all friends of YYYYYY. Can only lookup for the logged in user (XXXXX), or
friends of the logged in user with the appropriate permission"
I've done some research and see that this functionality wasn't available through the Facebook API up until October 2010. But then radio silence. Well, it's almost 6 months later. So was this ever implemented?
I have requested all permissions I need for my app as well.
This functionality does not exist in the Facebook Social Graph API or the FQL API.
During my quest to find out how to accomplish this I found many developers who asked the same question. Some developers have been asking for this feature for over 2 years. I think the FB team may consider it a privacy of performance concern.
I have worked on it. I was able to see friends of my friend.
It needs following requirements:
Your friend needs to be using application.
Permission from application read_stream, publish_stream, publish_checkins.
Try this fql query.
$query="SELECT uid, name, work_history FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 IN
( SELECT uid FROM user WHERE uid IN
(SELECT uid2 FROM friend WHERE uid1 = $fb_id ) and is_app_user=1)
)";