Here is my code to get the user information and verify it from my database.
<?php
require_once ("autoload.php");
include_once 'config.php';
$facebook = new FacebookFacebook(array(
'app_id' => FACEBOOK_APP_ID,
'app_id' => FACEBOOK_APP_ID,
'cookie' => true,
));
$parm = array(
'scope' => 'read_stream, friends_likes',
'redirect_uri' => 'https://apps.facebook.com/isensor/'
);
$uid = $facebook->getUser();
if($uid)
{
try {
$fbme = $facebook->api('/me');
$access_token = $facebook->getAccessToken();
}
catch (FacebookApiException $e)
{
error_log($e);
$user = null;
}
}
I think facebook has removed the getUser() function. Can anyone please tell me how should I fix this?
2
Answers
The Facebook docs (here) refer to getGraphUser()
You should use getGraphUser() because getUser() was deprecated on SDK v.3.2.3
Take a look at Facebook Graph SDK
I hope this helps.