Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, this is definitely possible, but you have to use <a href="https://developers.facebook.com/docs/guides/web/" rel="nofollow noreferrer">Facebook Connect</a> and <a href="http://wiki.developers.facebook.com/index.php/XFBML" rel="nofollow noreferrer">XFBML</a>. Specifically, you want to use the <a href="https://developers.facebook.com/docs/reference/fbml/serverFbml/" rel="nofollow noreferrer">fb:serverfbml</a> tag to get fb:friend-selector working. I have an iframe app whereby I use all of this and the fb:friend-selector in the standard "invite friends to your app" context, and it works great.</p> <p>Here is the body of my template file, which gets output inside the body of my iframe:</p> <pre class="lang-html prettyprint-override"><code>&lt;fb:serverfbml style="width: 650px;"&gt; &lt;script type="text/fbml"&gt; &lt;fb:fbml&gt; &lt;fb:request-form action="http://example.com/invite/sent" method="POST" invite="true" type="My App" content="Try out my app! &lt;fb:req-choice url='http://your-facebook-canvas-url' label='&lt;?php echo htmlspecialchars("Accept button text",ENT_QUOTES); ?&gt;' /&gt; " &gt; &lt;fb:multi-friend-selector showborder="false" actiontext="Invite your friends to try My App." exclude_ids="&lt;?php echo $excludeIds; ?&gt;" rows="3" /&gt; &lt;/fb:request-form&gt; &lt;/fb:fbml&gt; &lt;/script&gt; &lt;/fb:serverfbml&gt; </code></pre> <p>In the footer of the page, I have the standard Facebook Connect code, which will load and render the fb:serverfbml contents:</p> <pre class="lang-html prettyprint-override"><code>&lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; FB_RequireFeatures( ["CanvasUtil"], function(){ FB.XdComm.Server.init('/xd_receiver.html'); FB.CanvasClient.startTimerToSizeToContent(); } ); &lt;/script&gt; &lt;script type="text/javascript"&gt; FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("Your Facebook API Key", "/xd_receiver.html"); }); &lt;/script&gt; </code></pre> <p>That should be all you need (fill in your own options where applicable, of course). You'll have to set up Facebook Connect to work with a cross-domain receiver file. I suggest following the <a href="http://wiki.developers.facebook.com/index.php/XFBML#Rendering_XFBML" rel="nofollow noreferrer">rendering XFBML steps</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload