Android: How to get facebook user image using access_token

后端 未结 3 680
Happy的楠姐
Happy的楠姐 2021-02-09 19:37

I am working on an application that need to login with facebook. This is the first time when i am integrating Fb API in my application. I have start from Getting St

3条回答
  •  北海茫月
    2021-02-09 19:52

    You don't need an access token to retrieve a user's profile image. Just issue a http GET request on http://graph.facebook.com/YOUR_ID_HERE/picture, so for example:

    http://graph.facebook.com/4/picture gets you user id 4's picture, no access token needed.

    EDIT:

    To fetch the picture without knowing their fb id but with their access token, just execute a GET request on /me?fields=name,picture and you will receive a response with the URL to their profile picture.

    See Graph API Tool example:

    https://developers.facebook.com/tools/explorer/?method=GET&path=me%3Ffields%3Dname%2Cpicture

提交回复
热议问题