facebook connect- $user_id = $facebook->getUser(); always returning 0 [duplicate]

To get rid of this issue you need to do the following

Change

$login_url = $facebook->getLoginUrl(array(
    'scope'     => 'email,user_location,user_photos,publish_actions,basic_info', 
    'redirect_uri'  => 'http://localhost/dist/'
    ));

to

$login_url = $facebook->getLoginUrl(array(
    'scope'     => 'email,user_location,user_photos,publish_actions,basic_info', 
    'redirect_uri'  => 'http://localhost/dist/index.php'
    ));

Leave domain name blank in the following setting. Dont give localhost.com

App Domains : localhost.com

Then

Valid OAuth redirect URIs :http://localhost/dist/

to

Valid OAuth redirect URIs :`http://localhost/dist/index.php

Now try there after.

Leave a Comment