簡體   English   中英

無法使用api 2.5獲取Facebook用戶的時間軸

[英]Cannot get the facebook's user's timeline with api 2.5

我正在嘗試在我的Android應用程序中獲取Facebook用戶的時間表。 這是我的代碼:

mLoginButton.setReadPermissions(Arrays.asList("user_about_me", "user_friends", "user_likes",
            "user_photos", "user_relationships", "user_posts",
            "user_status"));

    // If using in a fragment
    mLoginButton.setFragment(this);
    // Other app specific specialization

    // Callback registration
    mLoginButton.registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {

        @Override
        public void onSuccess(LoginResult loginResult) {
            mAccessToken = loginResult.getAccessToken();

            for (String permission : loginResult.getRecentlyGrantedPermissions()) {
                Log.d(LOG_TAG, "Granted Permission:" + permission);
            }

            getUserFeed();
        }

        @Override
        public void onCancel() {
            // App code
        }

        @Override
        public void onError(FacebookException exception) {
            // App code
        }
    });

登錄后,我啟動這個:

private void getUserFeed() {

    Bundle params = new Bundle();
    params.putInt("limit", 25);
    params.putString("fields", "id,name,link,full_picture,message,story,picture,type,place,from,to");
    params.putBoolean("summary", true);

    /* make the API call */
    new GraphRequest(
            AccessToken.getCurrentAccessToken(),
            "/me/home",
            params,
            HttpMethod.GET,
            new GraphRequest.Callback() {
                public void onCompleted(GraphResponse response) {
                    try {
                        final JSONArray data = response.getJSONObject().getJSONArray("data");
                        //currentJson = response.getJSONObject();
                    } catch (JSONException e) {
                        Log.e("Error: ", e.toString());
                    }
                }
            }
    ).executeAsync();

}

我有來自Facebook的以下響應代碼:

Requires extended permission: read_stream

我知道此權限已棄用,我正在使用最新的API 2.5。

您是否知道我們現在是否可以繼續獲取用戶的時間軸,如果我將“ / me / home”替換為“ / me / feed”就可以了,但是我只是得到自己的帖子,而不是我的整個時間軸。

謝謝 :)

您知道我們現在是否可以繼續獲取用戶的時間表,

不,你不能。

如果我將“ / me / home”替換為“ / me / feed”就可以了,但是我只是得到自己的帖子,而不是整個時間表。

/me/home和許可已被棄用。

/me/feed是您現在可以獲得的,就是這樣。

您可以在此處列出希望看到的帖子: https : //developers.facebook.com/docs/graph-api/reference/v2.5/user/feed#readperms

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM