Hi Everybody,
I’m trying to develop an app that pulls in the gender from all of a user’s facebook friends. Then the user selects male, female, or both. After that 3 from the desired catagory will be randomly chosen and their profile photos and names will appear onscreen.
I’m using facebook.request( “me/friends” ) but that returns their names and friend id’s. But using the friend ids I’m having trouble pulling out the gender, which is listed as public information, without going through a login process. I’ve tried to use “http://graph.facebook.com/”… friendID …"/gender" but that doesn’t seem to be working. I also need this to be fairly fast in case someone has 2000 friends. I imagine I’ll be able to use facebook.request( ) for this, but I haven’t found a way to do anything with it that doesn’t involve “me”.
In a separate issue, I’ve figured out how to pull in profile pictures, but they are really really small. Is there a method to get a larger size image? This doesn’t need to be fast because I’m only going to be pulling in three at a time. Here’s my working code for the profile pictures:
[lua]–the friend id’s are already loaded into a variable called data. So data[i].id will pull in a single id.
–displaying pictures using graph.facebook method (only returns 50 pixel images
local function networkListener( event )
if ( event.isError ) then
print ( “Network error - download failed” )
else
event.target.alpha = 0
transition.to( event.target, { alpha = 1.0 , xScale = 2, yScale = 2} )
end
print ( "RESPONSE: " … event.response )
end
for i=1,#data do
display.loadRemoteImage(“http://graph.facebook.com/”… data[i].id …"/picture",“GET”, networkListener, “image”…i…".png", system.TemporaryDirectory, 200,i*100)
end [import]uid: 10211 topic_id: 8235 reply_id: 308235[/import]