I have a problem that doesn’t seem to have an easy answer, so if you could point me to the right direction…
We have an idea to use WordPress Network as a mean of easy facebook app distribution/CMS system, and so far the basic integration is working… herein lies the problem as we can’t seem to authenticate an user (via facebook and the scope) to get basic information such as FB ID, name etc… as you can when you make your FB apps by yourself in FB Canvas.
Just like when you use any facebook app that wants your basic info, it than asks you for permission (scope?)
Any thoughts?
Be sure to instantiate the Facebook object properly by including the sdk on any page you are attempting to authenticate from. If you attempt to just include it in the header.php file of a WordPress theme and reference the variables in any other theme file (single.php, category.php) it won’t work due to get_header(); being a function, not an include. The Facebook variables, such as $user, won’t carry over unless the sdk is loaded on each page.
I ran into similar issues with combining wordpress and the Facebook PHP SDK and this is a solution I’ve come to that works.
I also suggest instantiating the Facebook Object in a separate file and then including that rather than placing all the sdk code at the top of each template file. Hope this helps.