user3351517
user3351517

Reputation: 49

Codeigniter FacebookSDK, base_facebook.php library

Hello there I am listing now the base_facebook.php file and can't see in there a function which gives back the username of the user. There is only a function getUser() which returns the user ID. Can you navigate me about the way how to take the username of a user with this FB SDK in codeigniter ?

Upvotes: 0

Views: 187

Answers (1)

andyrandy
andyrandy

Reputation: 74004

You would need to make an API call to get the user details:

$me = $facebook->api('/me');
var_dump($me);

Although, the username is not included anymore since v2.0, for privacy reasons.

This is for the old PHP SDK btw, but i assume that is what you are using. The new one works completely different and needs PHP 5.4+. Here´s a tutorial, just in case: http://www.devils-heaven.com/facebook-php-sdk-4-0-tutorial/

Upvotes: 1

Related Questions