简体   繁体   中英

How to post game score in facebook using graph api in android?

I am developing an android game and i am trying to use Facebook's graph Api to create a leaderboard for my android game integrated. how can is post my score in game to facebook ?

here, i'm trying to call following facebook graph url.

https://graph.facebook.com/10000557xxxxxxx/scores?score=2200&access_token=CAAGmYpJsHQYBACuYb5zEgF1kyKU9nwHFJNkn7ZBZCbZCmGogNR3Ls5SuQ0xECYDUZAcFVZAL5awcCruvpx1NhgYPeqmP84e4ribBFmmthDYwl6jbCbwX51dpg5eZAEurIBxxxxTAmMmC6q2kKhx7A9p8EZBHJS407IQ6BKT3tGnNZBoHByr2uJoH78ZBWbZAYmLMh8RMUmzEdl9UDfxxxxxxxx

but i have getting following response, but it contains my old score every time.

{

"data": [
    {
        "user": {
            "id": "1000055754xxxxxxx",
            "name": "Sumit Paxxxxxxxxx"
        },
        "score": 2029,
        "application": {
            "name": "Cute",
            "namespace": "cute",
            "id": "4644172702xxxxxx"
        }
    }
]

}

You need to do a POST request instead of a GET one. See:

Sample:

POST /me/scores

with the following body:

score=2200

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM