It's definitely possible without a fb:login-button
. In fact, if you're building an iframe app, then you probably don't need an fb:login-button
at all. All you need is to load the Facebook Connect libraries, and then make the initialize call, like this (using your own API key of course):
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
FB.init("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "/xd_receiver.htm");
window.addEvent('domready',function(){
FB_RequireFeatures(["CanvasUtil"], function(){
FB.XdComm.Server.init("/xd_receiver.htm");
});
});
</script>
Note that I've got a bit of MooTools in there to make sure the RequireFeatures
call happens after the DOM is ready. You can stick to the examples in the initializing docs if you want.
Anyway, once you've loaded and initialized the FB Connect libraries, you should have full access to the API methods that the JS library provides, and you can simply do this:
var user_message_prompt = "Write something here!";
var user_message = {value: "Default message"};
if (FB.Connect) {
FB.Connect.showFeedDialog(templateBundle, templateData, null,null,null,FB.RequireConnect.require,null,user_message_prompt,user_message);
}