Wallpaper-da ishlamayotgan Facebook GraphAPI ilovalari harakati

Men ilovalarning devorlarga yozilishiga harakat qilmoqchiman, lekin hech narsa yordam bermayapti. Men noto'g'ri ish qilyapman?

  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"}]
  })  
1

1 javoblar

Siz JSON dagi JSON jildini ishlatib, uni bajarishingiz kerak.

json o'rnatish

keyin qatorni json ga aylantirish uchun to_json foydalaning:

 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"}].to_json
  })  

Siz bajarilgansiz :)

1
qo'shib qo'ydi