Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Mono C# Android Facebook
hello coders,
Hit a weird discrepancy in FQL (Facebook query language). The facebook developer's site is really unorganized and I'm having trouble finding an answer. The sample code for the Facebook SDK demonstrates FQL with this code:
var query = string.Format("SELECT uid,name,pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1={0}) ORDER BY name ASC", "me()");
	FacebookClient fb = new FacebookClient (userToken);
 
	fb.GetTaskAsync ("fql", new { q = query }).ContinueWith (t => {
		if (!t.IsFaulted) {
			var result = (IDictionary<string, object>)t.Result;
			var data = (IList<object>)result["data"];
			var count = data.Count;
			var message = string.Format ("You have {0} friends", count);
 
This pops up a little alert that shows how many friends the current user has. Simple and easy right?
Well, I changed the query to look something like this-
var query = string.Format("SELECT flid, name, type FROM friendlist WHERE owner={0} ORDER BY name ASC", "me()");
And even though the return data appears to be in the same format, The count returns zero every time. Im stumped.
This step is only being used for debugging purposes. Eventually I plan on filling a spinner with the user's friend lists. Can do that until I figure out how to extract this data. Any help would be hot. Thanks.
Posted 28-Mar-13 9:51am
Comments
richcb at 28-Mar-13 14:55pm
   
What is "me()"? You are setting that as your value in the where clause to check for owner and uid1 in your select statements.
Member 9950199 at 28-Mar-13 15:24pm
   
me() is a function built into FQL to return the current userID. It needs to be passed through the query. The example I posted demonstates a working query. Still stumped.
richcb at 28-Mar-13 15:28pm
   
I agree with Sandeep, if me() is a method, it needs to be passed as such and not as a string value, unless it is used in the database.
ryanb31 at 28-Mar-13 16:57pm
   
What is "me()"? Proper English would be "Who am I?" You're welcome. :)
richcb at 28-Mar-13 16:58pm
   
Lol, nice.
Sandeep Mewara at 28-Mar-13 15:00pm
   
Based on what you have shared, I guess me() should be without quotes.
ryanb31 at 28-Mar-13 16:09pm
   
I believe me() gets executed in the context of the FQL so the way it is is correct. However, the OP should notice that this is not the best place to ask about FaceBook API. :) Facebook would be a better place.
Member 9950199 at 28-Mar-13 16:32pm
   
That would be correct sir. And finally found this site here:
http://facebook.stackoverflow.com/search?q=fql+friendlist
 
Ill repost there and see if anyone has some insight. Thanks.
richcb at 28-Mar-13 16:36pm
   
Interesting, learned something new today.
Sandeep Mewara at 28-Mar-13 23:48pm
   
True. Agree with you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 28 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100