Android app using Facebook login: An active access token must be used to query information about the current user

穿精又带淫゛_ 提交于 2019-12-04 13:55:35

Try this

if (state.isOpened())
{
    Log.i("Facebook", "Logged in...");

    new Request(session, "me/photos",getRequestParameters(), null, new Callback()
    {           
        @Override
        public void onCompleted(Response response)
        {


        }
    }).executeAsync();

....


private Bundle getRequestParameters() 
{
       Bundle parameters = new Bundle(1);
       parameters.putString("fields", "images,other");
       return parameters;
}

Am i implementing 4.6.0 FacebookSDK and phasing these error but after manage proper structure of classes got success..!!

AccessToken Class object's initialize after GraphRequest class & inside GraphRequest use object of AccessToken

AccessToken accessToken = AccessToken.getCurrentAccessToken();
GraphRequest request = GraphRequest.newMeRequest(accessToken, new GraphRequest.GraphJSONObjectCallback() {

                    @Override
                    public void onCompleted(JSONObject object, GraphResponse response) {
                        // Application code
                        System.out.println("object>>" + object);
                        System.out.println("response>>" + response.toString());

                    }
                });
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!