在 android 中获得所有没有分页的 facebook 赞

get all facebook likes without pagination in android

我正在使用此代码,returns 只有 25 页我喜欢。我怎样才能获得更多?

new Request(facebook.getSession(),
        "/me/likes",
        null,
        HttpMethod.GET,
        new Request.Callback() {
    @Override
    public void onCompleted(Response response) {


        JSONArray   arr = null;
        GraphObject go  = response.getGraphObject();
        JSONObject  jso = go.getInnerJSONObject();

我试过了:

/me/likes?limit=999"

这给了我空值。

您不能只获取所有条目,默认限制为每次 API 调用 25 个,您需要实施分页以获得更多结果:https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

这意味着,如果你想获得 100 个条目,你需要使用 4 API 次调用来获得所有条目。对下一批 25 个条目的调用在结果的 "next" 值中,您可以在文档中阅读。

没有分页就无法获取所有条目,除非只有 25 个 ;) - 您可以尝试使用更小的限制,如 50 或 100,看看它是否有效,但绝对有一个最大限制和不是很高。