Welcome to WebmasterWorld Guest from 54.167.177.207

Forum Moderators: coopster & jatar k

Facebook API confusion

The Facebook API does not perform as expected

   
10:09 am on Oct 1, 2012 (gmt 0)



Using the following code, I expect to receive the email address in the information supplied by Facebook.
$fbconfig = array(
'appId' => 'app id placed here',
'secret' => 'app secret placed here',
'cookie' => true
);
$fbpermissions = array('req_perms' => 'email');
include("dynamic/facebook.php"); /* load the Facebook SDK */
$facebook = new Facebook($fbconfig); /* create instance of Facebook class */
$user = $facebook->getUser(); /* Get User ID */
if ($user) {
try { /* Proceed knowing you have a logged in user who's authenticated.*/
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}

This is a print_r of what I actually get
Array
(
[id] => 464646461
[name] => Rasputin Ghost
[first_name] => Rasputin
[last_name] => Ghost
[link] => link to rasputin.ghost
[username] => rasputin.ghost
[gender] => male
[timezone] => 2
[locale] => en_US
[verified] => 1
[updated_time] => 2011-03-18T21:59:27+0000
)


As you can see, no email address
I am probably doing something totally stupid but I cannot see what it is.
I think that the app on Facebook is set up correctly - if it was not, I would not get anything back - right?
Any ideas or suggestions - this is driving me around the bend.
Someone made the comment that Facebook may not like me because I had not updated since March 2011 - Is that a possibility?
7:16 pm on Oct 14, 2012 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Which API are you using? Graph?
[developers.facebook.com...]
7:13 pm on Oct 16, 2012 (gmt 0)



Looks like it is graph - line 702 on base_facebook.php quotes "It relies on Facebook's Graph API"
Any help would really be appreciated - I need it for about 6 sites now.
4:13 pm on Oct 24, 2012 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



>>line 702 on base_facebook.php quotes "It relies on Facebook's Graph API"

Looks like you are using a 3rd party FB wrapper here, a class developed by somebody else. You may have to dig in a little deeper to the code or contact the developer. OR, just use the FB API and ditch the wrapper class.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month