簡體   English   中英

(#803) 您請求的某些別名不存在:{education-experience-id} Android

[英](#803) Some of the aliases you requested do not exist: {education-experience-id} Android

我正在嘗試從 facebook 獲取用戶的教育細節和工作描述。 我成功登錄並獲得訪問令牌。 但我無法獲得我想要的詳細信息

我正在使用的代碼:-

    public void getUserExpandEducation() {

    new GraphRequest(
            AccessToken.getCurrentAccessToken(),
        "/{education-experience-id}",  //"/{user_education_history}",//  
            null,
            HttpMethod.GET,
            new GraphRequest.Callback() {
                public void onCompleted(GraphResponse response) {
                    Log.d("fb response",response.toString());
                }
            }
    ).executeAsync();
}

任何人都可以請回復

我收到錯誤 (#803) 您請求的某些別名不存在:{education-experience-id}

最后,我通過這段代碼獲得了完整的工作和教育細節:

GraphRequest request = GraphRequest.newMeRequest(
            accessToken,
            new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(
                        JSONObject object,
                        GraphResponse response) {

                    FirstNameSocial = object.optString("first_name");
                    LastNameSocial = object.optString("last_name");
                    GenderSocial = object.optString("gender");
                    EmailSocial = object.optString("email", "");
                    id = object.optString("id");


                    if (!EmailSocial.equals("")) {
                        login_type = Config.Login_Type_facebook;
                        callAPI(EmailSocial, id, "");

                    } else {
                        Toast.makeText(getApplicationContext(), "Permision Denied", Toast.LENGTH_LONG)
                                .show();
                    }

                }
            });

    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,email,birthday,gender,first_name,last_name,picture,education,work");
    request.setParameters(parameters);
    request.executeAsync();

可能會幫助某人! 快樂編碼:)

確保您獲得了該權限: user_education_history

獲取教育 ID 列表的 API 調用: https ://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Deducation

在您的代碼中,您需要將以下字符串替換為生成的教育 ID 之一: {education-experience-id}

例如:

new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/12345",
        null,
        HttpMethod.GET,
        new GraphRequest.Callback() {
            public void onCompleted(GraphResponse response) {
                Log.d("fb response",response.toString());
            }
        }
).executeAsync();

暫無
暫無

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

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