title: Facebook online friend
body: <p>ive tryed some solution found here to get a list of my friend online:</p>
  
  <p><a href="https://stackoverflow.com/questions/5433150/facebook-fql-query-to-get-all-users-online">Facebook FQL query to get all users online</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1795934/how-to-get-list-of-online-friends-using-fql-with-facebook-api">How to get list of online friends using FQL with facebook API?</a></p>
  
  <p>this is my fql query:</p>
  
  <pre><code>$fql = "SELECT uid, name, online_presence, status FROM user WHERE uid IN 
  ( SELECT uid2 FROM friend WHERE uid1 = '".$me['id']."')";
  </code></pre>
  
  <p>But the presence field is empty for 99% of my friends. I get the presence (active, idle, offline), only for 6/7 friends. the same for the status field.</p>
  
  <p>How i can get the complete presence and status data? What i'm missing? I need to request a particular permission for my app (currently i have only the basic).</p>
  
  <p>Thank you very much.</p>
  
  <p>EDIT: The @Roozbeh15 solution is the answer, but i need to fid why the result isn't the same number of user i hvae in chat. The fql user count is always &lt; than the user in fb chat. Do you know why?</p>