FriendsOfSymfony / FOSFacebookBundle

NOT MAINTAINED - see https://github.com/hwi/HWIOAuthBundle
322 stars 140 forks source link

How to get the cover #311

Open vdrouet opened 10 years ago

vdrouet commented 10 years ago

I want to get the Facebook cover when a new user logIn, this field is not in the $fbdata array. Any idea how can i get it in the facebook graph using fosfacebookbundle ?

Thanks a lot

tvl83 commented 10 years ago

Using the Graph API Explorer I found out that /username?fields=cover will give you a cover object

{ "cover": { "id": "12345678900987654321", "source": "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-frc3/t1/s720x720/1234567890.jpg", "offset_y": 0 }, "id": "1234567890" }

so $this->container->get('fos_facebook.api')->api('/me?fields=cover') will get the object for the current user logged in.