for the fbconnect login button http://wiki.developers.facebook.com/index.php/Fb:login-button , resizable iframes http://wiki.developers.facebook.com/index.php/Resizable_IFrame, and other fb features to work, the application must include the fb FeatureLoader,
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
*
grepping for "FeatureLoader", no results were returned in sites/all/modules/fb or in sites/all/libraries/facebook-php-sdk. is the fb module package including FeatureLoader.js.php some other way that hashes the name?
using a zen sub-theme, if i include * in the header, the fbconnect login button doesn't show but the resizeable iframe code works; if * is excluded, the fbconnect login button does show but the resizable iframe code is broken. the resizeable iframe code is implemented in the following way, per the fb wiki page linked above:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
...
<script type="text/javascript">
function fixHeight()
{
//We need to call FB.CanvasClient.stopTimerToSizeToContent() first because we have called FB.CanvasClient.startTimerToSizeToContent() earlier
FB.CanvasClient.stopTimerToSizeToContent();
FB.CanvasClient.setSizeToContent();
}
</script>
...
</head>
<body class="<?php print $body_classes; ?>" <?php if ($_REQUEST['fb_sig_in_iframe'] == 1){print 'onload="fixHeight();"';} ?> >
...
<!-- http://wiki.developers.facebook.com/index.php/JavaScript_Client_Library -->
<div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div>
<?php
if ($_REQUEST['fb_sig_in_iframe'] == 1){
print '
<!--start iframe resize script-->
<!--script type="text/javascript">
FB_RequireFeatures(["CanvasUtil"], function(){
FB.XdComm.Server.init("/xd_receiver.htm");
FB.CanvasClient.startTimerToSizeToContent();
});
</script-->
';
}
?>
</body>
now if you've read this far, you'll notice that the statement
FB.XdComm.Server.init("/xd_receiver.htm");
initializes the xdcomm receiver that you've implemented with fb_connect.module::fb_connect_receiverXX() - and whose output is explicitly included as fb/fb_receiver.html in the package root.
...i can't find where fb_connect_receiverXX() is called anywhere else, grepping for the function in libraries/facebook-php-sdk and modules/fb. the call to
FB.CanvasClient.startTimerToSizeToContent();
must be included just before the closing [/body] tag per the fb wiki page.
will you please shed some light on if/when FeatureLoader and the receiver files are loaded and initialized?
Comments
Comment #1
Dave Cohen commentedEverything you're writing about is true for the old libraries. If you want those, use the 2.x branch.
http://apps.facebook.com/drupalforfacebook uses the newer 3.x branch. To auto-resize the canvas pages, I have this code near the end of page.tpl.php for the canvas page theme.
I put that right before where
$closureis printed.Comment #2
jaypark commentedthanks dave, that worked - with the fb application setting
migrations > new sdks > enabled
however, i now have the bug described at http://drupal.org/node/408432 - i'll post in that thread.
Comment #3
jaypark commentedDave, your script #1 works for 3.x but not 2.x - is there a way to reference this receiver for every fb_cb/* path with 2.0-rc2?