'Get facebook profile picture always return silhouette
Everyone knows https://graph.facebook.com/[facebook_id]/picture?redirect=false
will retrieve the URL of the profile picture.
I've tried it on browsers, NestJS back end, etc.
I don't know why it turns into a silhouette picture but when I provided the access_token the URL was changed to https://platform-lookaside.fbsbx.com/....
that not return the silhouette anymore. This gives me the profile picture but it is always downloaded rather than just displayed. Moreover, the URL from my latest approach is a signed URL and it has expiration time but I need a static URL for the profile picture.
Did anyone have an idea for this? Thank you.
Solution 1:[1]
According to the docs
GET /{user-id}/picture requests made by apps in Development mode using either (1) a Client access token or (2) tokenless requests on an App-Scoped User ID will receive a silhouette image instead of the app user's profile image in response.
See full documentation here
Solution 2:[2]
It's solved!
Just use the url directly in src of img
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Knower Boye |
Solution 2 | vyppN |