CakePHP-Facebook-Plugin icon indicating copy to clipboard operation
CakePHP-Facebook-Plugin copied to clipboard

FB::api('/me') doesn't work ?

Open ousmaneo opened this issue 13 years ago • 5 comments

Hi i'm getting php warning when trying to access to the facebook api :

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object [APP/Plugin/facebook/Lib/FB.php, line 58]

and the FB::api('/me') call doesn't show any result ? Any help well be great !!!! Thanks

ousmaneo avatar Jan 26 '12 09:01 ousmaneo

Have you included the App::uses('FB', 'Facebook.Lib'); in your controller?

ghost avatar May 25 '12 11:05 ghost

same here , latest git and php 5.3, cake 2, any idea?

simonbuehler avatar Aug 09 '12 17:08 simonbuehler

5.3.10-pl0-gentoo via FPM/FastCGI fails with FB::api('/me') but $Facebook = new FB(); $fbsession= $Facebook->api('/me');

works, strange ... any fix?

simonbuehler avatar Aug 09 '12 19:08 simonbuehler

i am having the same problem, when i put the component 'Facebook.Connect" i have this warning:

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Facebook' does not have a method 'getSession' [APP/Plugin/Facebook/Lib/FB.php, line 34]

anybody has fixed?

jeffersonrbr avatar Aug 17 '12 19:08 jeffersonrbr

Facebook has changed the name of the API method getSession to getUser. It's ridiculous they cant provide an alias for backward compatibility, so both calls work. They just changed the method's name and broke thousands of apps by doing that. Not so nice developer treatment. Anyway you have to change the method name getSession to getUser. Don't know where exactly this method is called throughout the plugin, but should be fixed if you just search for all this calls in your plugin and replace the name to getUser.

PMoser avatar Sep 23 '12 10:09 PMoser