PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] Codeigniter FacebookSDK, base_facebook.php library

 February 11, 2022     codeigniter, facebook-php-sdk     No comments   

Issue

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 ?


Solution

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/



Answered By - andyrandy
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing