Accessing friend list from facebook

I would like to access the name and id of the friend list from my facebook account.

The code is given below.

 if ( "login" == event.phase ) then  
 facebook.request( "me/friends" )  
 end  
 local response = event.response  
 if ( not event.isError ) then  
 response = json.decode( event.response )  
 local friends = {}  
 local data = response.data  
 for i=1,#data do  
 local name = data[i].name  
 table.insert( friends, name )  
 end  
  
 local topBoundary = display.screenOriginY + 40  
 local bottomBoundary = display.screenOriginY + 0  
  
 -- create the list of items  
 myList = tableView.newList{  
 data=friends,   
 default="listItemBg.png",  
 --default="listItemBg\_white.png",  
 over="listItemBg\_over.png",  
-- onRelease=listButtonRelease,  
 top=topBoundary,  
 bottom=bottomBoundary,  
 backgroundColor={ 255, 255, 255 },  
  
 callback=function(row)   
 local t = display.newText(row, 0, 0, native.systemFontBold, 16)  
 t:setTextColor(0, 0, 0)  
 t.x = math.floor(t.width/2) + 12  
 t.y = 46   
 return t  
 end  
  
  
  
  
 }  
  

Could any one please help me the solution to this problem? Is this correct? Some bug is coming due to which, I am not able to run it correctly in the XCode Simulator?
[import]uid: 96608 topic_id: 18867 reply_id: 318867[/import]

Hi , i faced the same problem and i wanna ask u if u solve this plz i need ur help [import]uid: 96650 topic_id: 18867 reply_id: 129988[/import]

Hi , i faced the same problem and i wanna ask u if u solve this plz i need ur help [import]uid: 96650 topic_id: 18867 reply_id: 129988[/import]