I am wondering, how can i use Facebook api to download user image, that is currently logged in. I don’t have problems with logging in and getting a name of current user, but downloading user picture returns nothing on my android device, as i can’t trace any mistakes on simulator.
So i tried to download both with async method and loadRemoteImage, but I think the main problem is that i can’t get a correct id of user.
I tried smth like that
if ( "login" == event.phase ) then facebook.request( "me", "GET" ) end elseif ( "request" == event.type ) then local response = event.response print( response ) end if ( "request" == event.type ) then local response = Json.Decode( event.response ) local data = response.data local function showImage( event ) event.target.alpha = 0 event.target.xScale = 0.25 event.target.yScale = 0.25 transition.to( event.target, { alpha = 1.0 , xScale = 1, yScale = 1} ) end display.loadRemoteImage("http://graph.facebook.com/".. data.id .."/picture", "GET", showImage, "friend"..data.id..".png", system.TemporaryDirectory, math.random(0,display.contentWidth), math.random(0,display.contentHeight) )