title: Facebook iFrame app - displaying FB:ui depending on whether a user is logged in or not?
body: <p>I'm creating an iFrame app on Facebook which is basically just a Mailing List sign up page. However, when people click Sign Up, the FB:ui &quot;Post To Your Wall&quot; pops up and gives the user the option to share what they have just signed up for if they want to. It works fine.</p>
  <p>However, I want to find a way to display the FB:ui ONLY to users who are logged into Facebook. My app shouldn't require any permission from users as it is simply a landing page that gives people an option to share if they want to. There's never any automatic sharing done.</p>
  <p>I'm using the below code currently:</p>
  <pre><code>&lt;div id=&quot;fb-root&quot;&gt;&lt;/div&gt;
        &lt;script src=&quot;http://connect.facebook.net/en_US/all.js&quot;&gt;
        &lt;/script&gt;
  &lt;script&gt;
           FB.init({ 
              appId:'my app id', cookie:true, 
              status:true, xfbml:true 
           });
           
           FB.getLoginStatus(function(response) {
  if(response.session) {
  sharethisnow();
  } else {
  // no user session available, someone you dont know
  if(response.status == &quot;notConnected&quot;) {
  // But user is logged into facebook
  sharethisnow();
  } else {
  // User is not logged into facebook
  }
  }
  });
  
  function sharethisnow() {
           FB.ui({ method: 'feed',  
              link: 'my link',
              name: 'my page name',
              caption: 'my caption',
              description: 'my decription',
              picture: 'my picture',
              message: 'my message'});
              }
        
        &lt;/script&gt;
  </code></pre>
  <p>As you can see, I'm attempting to run the FB:ui (sharethisnow function) only to users who are either logged into Facebook AND my app, or logged into Facebook only. But for some reason the code above is only working for page-admins. When I log in as an admin, I sign up and the FB:ui pops up as it should do. However, when I view the page as a non-admin (just a general logged in Facebook user), the FB:ui pops up but says that there is an error and to &quot;please try again later&quot;.</p>