Am I stupid or is it complex?

(I am using Drupal7 with the latest version von Drupal 4 Facebook)

Since 4 weeks I am developing facebook apps - some with drupal/drupal for facebook and some without.

Everytime I choose to use Drupal for Facebook Development gets to be trial and error.
By using plain Facebook SDK it's easy. I can use the GraphAPI, FQL, the JS SDK etc.

Is there a documentation how to get form Facebook SDK to D4FB Code?

To use API calls I noticed to start with:
extract(fb_vars());

And there is a way to use $fb->api(), with does most of what I can do with the plain API.

But I couldn't use fb_fql_query and fb_api don't work like I expect it to work.

Do you know a proper way to use Facebook SDK in Drupal without Drupal for Facebook.

...I haven't managed that -> may I AM stupid. But without Drupal around Facebook API calls everything works like i expect it to work...

would be happy for advices, what I am doing wrong to have a happy live with D4FB

Using Drupal for Facebook,

Using Drupal for Facebook, when you call extract(fb_vars()); and get $fb, it will behave exactly the same as Facebook's SDK, because the $fb object is the Facebook SDK object. So, I'm curious what you mean that they are not the same.

fb_fql_query() and fb_api() are part of modules/fb for convenience. They don't match exactly to calls in the Facebook SDK. Looking at the comments in modules/fb/fb.module it should be pretty clear how they are supposed to work. And if they don't work as they are supposed to, I'd appreciate a report to the issue queue on Drupal.org.

(IMHO it is complex, mostly because the Facebook Platform is complex and has a long complicated history.)

How to Use FB for Drupal w/o setting as Primary Connect?

How to Use FB for Drupal w/o setting as Primary Connect?

Hi Dave,

Why am I getting blank values for the fb_vars (all $fb, $fb_app, $fbu)? but if i select my application as Primary Connect Application in the Drupal admin, I am able to retrieve the values. But when I set that, I get the infinite redirect loop when logging in.

Yes, you can choose not to

Yes, you can choose not to set a primary app. In that case the fb vars will only be initialized when one of your apps is explicitly initialized. The way to do that, without writing code, is to enable the block that comes with fb_connect.module on only the pages where you want your app to function.

Most users are better off setting a primary app, though. It is simpler.

The infinite loop is another issue. Might be that you're including facebook's javascript ("all.js") somewhere in your page, which prevents it from initializing properly.

Hi Dave, I already found what

Hi Dave,

I already found what the issue was. I was using sess_write/sess_read. When doing a sess_read where data is not available, Drupal logs me out, FB I think insists that I'm logged in and so forth thus the redirect loop.

I used the $_SESSION globals instead and I'm able to use the fb_vars() now.

Thanks so much! :)

My dilemma is that when I 1.

My dilemma is that when I

1. set Primary Connect Application - I have value for the fb vars BUT infinite loop for other pages

2. not set Primary Connect Application - I am able to navigate through the pages BUT no value for fb vars

I need the fb vars, otherwise, I will have to go through the session/cookie variables the old fashioned way.

Is this the normal behavior? Am I on the right track? Thanks so much!

If you have only one

If you have only one application, set it as primary. If you have an infinite loop, that's another problem which should be fixed properly.

Choosing not to use "primary" is more advanced. Don't use it if you plan to support facebook connect on some pages but not others. Or, if you support more than one facebook app.

I'm using the fb_footer() to

I'm using the fb_footer() to add the all.js. I have also used the FB connect block on my header which is used in my template on every page.

What do you mean when you said that "apps is explicitly initialized"?

Can you help me on how to setup the the module? From configuration to the Drupal admin settings? I already followed what was written in the README file. I might be missing something especially in the Drupal admin.

Thanks!