skip to Main Content

Full Error code: GraphResponse: {HttpStatus: 400, errorCode: 100, subErrorCode: 33, errorType: GraphMethodException, errorMessage: Unsupported get request. Object with ID ‘*************’ does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api}

I am trying to embed the facebook login in my android app. I have followed the QuickStart at facebook developers website to try and embed it.
The problem is that when I run my app, when it boots I get the error listed in the title. And when I click the button nothing happens. Find the attached code.

loginButton.setPermissions(Arrays.asList(EMAIL));
    // If you are using in a fragment, call loginButton.setFragment(this);

    // Callback registration
    loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {

        }

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

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


    });

    AccessTokenTracker tokenTracker = new AccessTokenTracker() {
    @Override
    protected void onCurrentAccessTokenChanged(AccessToken accessToken, AccessToken accessToken1) {
        auth.loadUserProfile(accessToken1);
    }
};

    public void loadUserProfile(AccessToken accessToken)
{
    GraphRequest request = GraphRequest.newMeRequest(accessToken, new GraphRequest.GraphJSONObjectCallback() {
        @Override
        public void onCompleted(JSONObject object, GraphResponse response) {
            try {
                String email = object.getString("email");

                System.out.println(email);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    });

    Bundle pararmeters = new Bundle();
    pararmeters.putString("fields", "email");
    request.executeAsync();
}

Above is my code

3

Answers


  1. You Code is missing with the callback function in the onActivityResult

    @Override
        public void onActivityResult(int requestCode, int resultCode, Intent data) {
            mcallbackManager.onActivityResult(requestCode, resultCode, data);
            super.onActivityResult(requestCode, resultCode, data);
    }
    
    Login or Signup to reply.
  2. call before setAutoLogAppEventsEnabled(true); before registerCallback and set it again
    to false when data is received from facebook

    Login or Signup to reply.
  3. I just got rid of this error, actually I was doing a mistake , when I was giving setPermission in that I was assigning wrong access permission. So, just check that permission carefully
    like here

    log_btn.setPermissions(Arrays.asList("email","user_birthday"));

    you can also check on developer page in app review section permission and features

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search