What causes the FB.Event.subscribe event to fire?
I know clicking an fb:login-button element can trigger it but the FB.Event.subscribe event is firing anytime a Facebook session is created.
Do other FBML elements automatically trigger this event when a Facebook session is present or does this event trigger regardless of regardless of any FBML elements present?
FB.Event.subscribe
by itself is not an event, it's just like the addListener where it hook an event to a function. You need to check your code to see what events you are using:I suppose you have the
auth.sessionChange
event used.I had this same issue, but the solution I found was:
FB.init
, set the parameter status to false (in almost all samples I saw it comes as true by default)So you'll end with something like it:
Notice that I made a callback function named FBLoginCallback(), so I can use this code in a MasterPage, and define the callback handling function in separated pages, each with its specific needs.
You can only know what triggers each event by looking at the Facebook docs or by looking through the JS SDK source code. Here are links for both of those:
In the JS source, look for calls to FB.Event.fire( ... ). You may have to do some more analysis to figure out the exact conditions, especially since my version of the JS is from a minified version of the SDK. Facebook does not release their actual source at this time so we have to make do with de-minifying the final SDK.