Facebook Scores API类型字段

时间:2015-06-17 09:11:57

标签: facebook api types field

我正在使用 Facebook Scores API ,我尝试使用字段"输入" 。正如API文档(https://developers.facebook.com/docs/games/scores#read-score)中所提到的,此字段存在且应该被阅读。

但是,API文档没有提及此字段来创建/更新分数(https://developers.facebook.com/docs/games/scores#create-update-scores)。

我在Android上使用v2.3 API版本,我通过这种方式发布数据:

Bundle params = new Bundle();
params.putInt("score", 30);
params.putString("type", "mytype");

/* make the API call */
new Request(
    session,
    "/me/scores",
    params,
    HttpMethod.POST,
    new Request.Callback() {
        public void onCompleted(Response response) {
            Log.d("Test", response.toString());
        }
    }
).executeAsync();

然后我得到了这个回复:

  

{Response:responseCode:200,graphObject:GraphObject {graphObjectClass = GraphObject,state = {" success":true}},error:null,isFromCache:false}

写入成功。

然后,当我读它时(在" / me / score"):

/* make the API call */
new Request(
    session,
    "/me/scores",
    null,
    HttpMethod.GET,
    new Request.Callback() {
        public void onCompleted(Response response) {
            Log.d("Test", response.toString());
        }
    }
).executeAsync();

我明白了:

  

{响应:responseCode:200,graphObject:GraphObject {graphObjectClass = GraphObject,state = {" data":[{" score":30," user&#34 ;:{" id":" xxxx"," name":" Open Graph Test User"}," application&#34 ;:{" ID":" YYYY""命名空间":" ZZZZ""名称":&# 34; xyz"}}]}},错误:null,isFromCache:false}

所以没有关于该领域的痕迹"键入"。

我怎么能用这个字段?

0 个答案:

没有答案