openGraph API (facebook.request)

I’m trying to publish a score using the graph API, which is a built in action
Here’s my code:

  
local facebookListener = function( event )   
 if ( "session" == event.type ) then   
 if ( "login" == event.phase ) then   
 -- THIS WORKS FINE  
 facebook.request( "me/feed", "POST"....)  
 -- THIS DOESN'T WORK  
 facebook.request("me/scores" , "POST", {score=100,access\_token=event.token})  
 -- THIS DOESN'T WORK AS WELL  
   
 local postData = "score=".. 100 .. "&access\_token=" .. event.token  
 local params = {}  
 params.body = postData  
 network.request( "https://graph.facebook.com/me/scores",   
 "POST", facebookListener2,params )  
 -- AND facebookListener2 NEVER GETS CALLED   
 end  
 end  
   
facebook.login( appId, facebookListener, {"publish\_actions"} )  

I’m trying to implement what’s on page 25 in this (official facebook) presentation:
https://www.sugarsync.com/pf/D7793105_2123952_8514553

Anyone ever implemented something like this?
[import]uid: 150930 topic_id: 32461 reply_id: 332461[/import]

I’ve just implemented this. and this is how I did it:

function M.publishScore(score)  
 local attachment =  
 {  
 score = tostring(score)  
 }  
  
 facebook.request("me/scores", "POST", attachment)  
end  

If I set score=integer then the facebook request call fails and throws an exception saying it’s an illegal number (probably some internal bug in there), but passing it as a string seems to work fine.

I don’t think you need to attach the token, the Facebook module should handle this for you. [import]uid: 157093 topic_id: 32461 reply_id: 133270[/import]

I’ve just implemented this. and this is how I did it:

function M.publishScore(score)  
 local attachment =  
 {  
 score = tostring(score)  
 }  
  
 facebook.request("me/scores", "POST", attachment)  
end  

If I set score=integer then the facebook request call fails and throws an exception saying it’s an illegal number (probably some internal bug in there), but passing it as a string seems to work fine.

I don’t think you need to attach the token, the Facebook module should handle this for you. [import]uid: 157093 topic_id: 32461 reply_id: 133270[/import]