我正在尝试通过 FQL 多查询从 Facebook 获取我的 Android 应用程序中的数据,如下所述:http: //www.kanatorn.info/2011/12/31/fql-multiple-query-android-sdk-example/
这是我的代码:
Bundle params = new Bundle();
JSONObject multiquery = new JSONObject();
try {
multiquery.put("query1", "SELECT eid, name, start_time, is_date_only, pic_square, pic_big, location FROM event WHERE eid IN" +
"(SELECT eid FROM event_member WHERE uid=me() AND start_time >= now()) ORDER BY start_time");
multiquery.put("query2", "SELECT eid, rsvp_status, start_time FROM event_member WHERE uid=me() AND start_time >= now() ORDER BY start_time");
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
params.putString("method", "fql.multiquery");
params.putString("queries", multiquery.toString());
Session session = Session.getActiveSession();
Request request = new Request(session,
"/fql",
params,
HttpMethod.GET,
new Request.Callback(){
public void onCompleted(Response response) {
...
}
});
Request.executeAndWait(request);
我得到的结果如下:
{Response: responseCode: 500, graphObject: null, error: {HttpStatus: 500, errorCode: -1, errorType: Exception, errorMessage: Unsupported method, fql.multiquery}, isFromCache:false}
我不知道我的错误在哪里。它说unsupported method, multiquery
,但这实际上应该是一个有效的方法,对吧?我到处寻找类似的问题,但似乎只有我一个人遇到这个问题。我觉得我错过了一些简单的东西......如果有人可以帮助我,那就太酷了。谢谢!
顺便提一句。正常查询一切正常。