开发者

Facebook Publishing Score

开发者 https://www.devze.com 2023-04-10 19:23 出处:网络
I am trying to publish scores from my app. But unfortunately I am unable to do so. I even tried using the开发者_StackOverflow中文版 code snippet at http://developers.facebook.com/blog/post/539/ but fo

I am trying to publish scores from my app. But unfortunately I am unable to do so. I even tried using the开发者_StackOverflow中文版 code snippet at http://developers.facebook.com/blog/post/539/ but for some odd reason it didn't work for me. If someone can provide me with some basic guidelines I would really be helpful as that would help me build upon that system and move forward. I don't want any fancy publishing technique I am just looking forward to publishing score at the end of the game.

Using https://graph.facebook.com/user id/scores?score=10&access_token=acess_token returns

{

"data": [

]

}


Your example looks like a HTTP GET request (i.e. 'show me the scores of this user')

To update a score you either need to make a POST request, or 'fake' the POST request by adding ?method=post to your GET call

You'll also need to use an App Access Token, the instructions for obtaining this are at: https://developers.facebook.com/docs/authentication/#applogin


I've done it using javascript sdk, you can check out the source code for my game https://apps.facebook.com/tgif-game/ you should be checking out scripts/gameui.js for the calls to posting scores and getting the list of scores.


In the FaceBook Developer Dashboard set your app category as games. Then only you'll be able to post scores.

0

精彩评论

暂无评论...
验证码 换一张
取 消