Android - get facebook profile picture

后端 未结 28 2380
花落未央
花落未央 2020-12-12 15:13

I don\'t know why, but I am always getting null when I try to get the profile picture of the user. Do I need to set some specific permissions to get access?

Below is

28条回答
  •  猫巷女王i
    2020-12-12 15:44

    Bundle bundle = new Bundle();
    
    bundle.putString ("fields", "full_picture,message");
    
    new GraphRequest(
                    AccessToken.getCurrentAccessToken(),
                    "{page-id}/feed",
                    bundle,
                    HttpMethod.GET,
                    new GraphRequest.Callback() {
                        public void onCompleted(GraphResponse response) {
                /* handle the result */
                            Log.e("TAG", response.toString());
                        }
                    }
            ).executeAsync();
    

提交回复
热议问题