问题描述
我使用Android的Facebook SDK 4.2.0来为我的游戏创建排行榜.我在/me/scores graphPath中使用POST方法成功发布了分数:
I use Facebook SDK 4.2.0 Android to create the leader scoreboard for my game. I post successfully my score with POST method at /me/scores graphPath:
{Response: responseCode: 200, graphObject: {"success":true}, error: null}
但是,当我尝试在/me/scores 和/793295994100883/scores (793295994100883是我的APP ID)上获取分数时,我没有在JSON结果字符串中查看我的得分.
However, when I try to GET the score at /me/scores as well as /793295994100883/scores (793295994100883 is my APP ID), I didn't see my score in JSON result string.
{Response: responseCode: 200, graphObject: {"data":[{"user":{"id":"Facebook USER-ID","name":"Facebook USER-NAME"}}]}, error: null}
在 https://developers.facebook.com/tools/explorer 中,它返回了我的当我到达/793295994100883?field = scores {score}
In https://developers.facebook.com/tools/explorer, It return my expected string when I get at /793295994100883?field=scores{score}
"scores": {
"data": [
{
"score": 1234,
"user": {
"name": "Facebook USER-NAME",
"id": "Facebook USER-ID"
}
}
]
},
"id": "793295994100883"
请帮助解决此问题.如何使用Facebook SDK获得分数?
Please help with this issue. How can I get score with Facebook SDK?
谢谢!
推荐答案
您的应用程序使用哪个版本的Graph API?如果是v2.4,则必须指定要检索的每个字段.
Which version of the Graph API is your app using? If it's v2.4, you have to specify each field you want to retrieve.
在这里查看我的答案:
这篇关于使用GET方法的图形API得分无法返回得分字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!