Get Facebook user profile picture by ID

0
1340

If we are going to do Facebook login auhentication in our IONIC app then developer.facebook.com give us API of basic information data in that their is also path of user profile picture but that give us very low resolution of file and also that file has small dimensions.

This will helps you a lot to achieving best resolution and custom dimensions too

http://graph.facebook.com/” + facebookId + “/picture?type=square For instance: http://graph.facebook.com/67563683055/picture?type=square

There are also more sizes besides “square”. See the docs.

You can use following urls to obtain different sizes of profile images. Please make sure to add Facebook id to url.

Large size photo https://graph.facebook.com/{facebookId}/picture?type=large

Medium size photo https://graph.facebook.com/{facebookId}/picture?type=normal

Small size photo https://graph.facebook.com/{facebookId}/picture?type=small

Square photo https://graph.facebook.com/{facebookId}/picture?type=square

To get largest size of the image

https://graph.facebook.com/{userID}?fields=picture.width(720).height(720) 

or anything else you need as size. Based on experience, type=large is not the largest result you can obtain.

LEAVE A REPLY

Please enter your comment!
Please enter your name here