问题
In Graph API v1.0, I could get the profile picture of any user with the following call graph.facebook.com/{uid}/picture (fb doc).
In Graph API v2.0 facebook says it will return (a) app-scoped user ids for app users, and (b) temporary tokens for non-app users (through /me/taggable_friends and /me/invitable_friends api calls). Based on this, I would assume that the picture api call is deprecated in v2.0. However, the documentation makes it seem like there was not change to this call in v2.0.
Anybody knows if (full-size) public profile pictures of non-app users will be available in v2.0?
回答1:
It is still possible to get a person's profile picture in v2.0.
http://graph.facebook.com/v2.0/APP_SCOPED_ID/picture
will redirect to a picture of the user represented by that app-scoped ID.
If a user previously logged into your app when your app was coded against v1.0, they may still be known to your app by their original Facebook user ID. For this reason, http://graph.facebook.com/v2.0/ORIGINAL_USER_ID/picture
will also still work.
回答2:
/<user id>/picture
does not require an access token in V2.0 and will work even when <user id>
is an app scoped ID
The ID provided needs to be the user's actual ID or an app scoped IDthe response from /<user id>/invitable_friends or /<user_id>/taggable_friends won't work in the same way
Both of those APIs will also return you the full URL of the invitable or taggable user's photo as part of the response, though.
回答3:
It does work fine with original user IDs. For app-scoped IDs I haven't figured out how to use them.
While http://graph.facebook.com/v2.0/APP_SCOPED_ID/picture
is supposed to work with the new app-scoped IDs, I can only get this response:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
Note that this response is different from the response for completely invalid IDs. If you use an invalid user ID, you would get:
{
"error": {
"message": "(#100) No node specified",
"type": "OAuthException",
"code": 100
}
}
EDIT: As of May 10, 2014 this is a known bug.
The Graph API request that is currently working is
http://graph.facebook.com/v2.0/APP_SCOPED_ID?fields=picture
来源:https://stackoverflow.com/questions/23418493/are-non-app-users-pictures-still-avalible-in-facebook-open-graph-v2-0