Search code examples
facebookmagentofacebook-graph-apimagento-1.9

LitExtension Sociallogin facebook error: "Sorry, could not retrieve your facebook first name. Please try again"


I currently cannot signup/login using Facebook for my Magento site. I am using LitExtension Sociallogin Plugin. When I printed the array $userInfo in facebook controller _connectback() I am getting just two parameters 'name' and 'id'.

Even if I split the name to first name and last name it gets stuck as it doesn't get the email id of the user. I wasn't facing this issue earlier.


Solution

  • Solved!!..The issue was with facebook api v2.4. The given solution should work for Inchoo plugin also however i have not tested it. For litextension sociallogin plugin, the file which i modified is: app/code/community/LitExtension/Sociallogin/controllers/FacebookController.php

    In _connectCallback():

    $fields = array(
             'id', 'name', 'first_name', 'last_name', 'email'
              );
    $userInfo = $client->api('/me?fields=' . implode(',', $fields));
    

    Hope this helps!!