I’ve been trying to post app specific actions to wall posts but nothing seems to help. What am I doing wrong?
oauth = Koala::Facebook::OAuth.new(CLIENT_ID, CLIENT_SECRET, "http://myurl.com/fb_auth")
token = oauth.get_access_token(params[:code])
graph = Koala::Facebook::API.new token
p graph.put_wall_post("explodingdog!", {
:link => "http://youtube.com/",
:caption => "Youtube",
:actions => [{:name => "Share", :link => "http://google.com"}]
})
You must convert actions to JSON string, using json gem this is how you will do it:
then use to_json to convert your array to json:
You are done 🙂