2

I have just implemented the HWIOAuthBundle in my symfony project. Actually, it is configured with facebook and I am wondering if it supports retrieving friends list, gender and country?

If yes, could you please provide me an example of code for the function public function loadUserByOAuthUserResponse(UserResponseInterface $response)?

It would be really helpful.

Thanks.

Amine Jallouli
  • 3,919
  • 8
  • 36
  • 73
  • Look [here](https://gist.github.com/danvbe/4476697) – tttony May 21 '14 at 18:22
  • This is exactly the link I used for configuring my symfony project. Nevertheless, I still not able to get for example the gender of the user in the method `public function loadUserByOAuthUserResponse(UserResponseInterface $response)`. The configuration of HWIOauthBundle itself is correctly done. The only remaining problem is with this method loadUserByOAuthUserResponse. – Amine Jallouli May 22 '14 at 08:47
  • If you have a good link for the that function, it would be helpful. Thanks you very much. – Amine Jallouli May 22 '14 at 08:48

1 Answers1

3

I found the solution by my self!!!

HWIOAuthBundle supports retrieving any thing you want. All what you have to do is to specify it in the facebook api then through the method getResponse() you will have access to them.

$attr=$response->getResponse();
// then get your field like this
$user->setGender($attr['gender']);

I guess now it is easy.

Amine Jallouli
  • 3,919
  • 8
  • 36
  • 73