Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Once that user accepts permissions to your app, you can call the <code>/me/friends</code> to get a list of friends, then you can parse thru that list looking at the <code>installed</code> property to determine if that friend is one of your app users.</p> <p>Another way, the better of the two as only one call as well as no parsing after the call, would be to use FQL to query the friends list </p> <p><code>fql?q=SELECT uid, name, is_app_user FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me()) and is_app_user=1</code></p> <p><strong>EDIT</strong></p> <p>PHP example of how to run FQL code. Taken from <a href="http://developers.facebook.com/docs/reference/fql/" rel="nofollow">http://developers.facebook.com/docs/reference/fql/</a></p> <pre><code>&lt;?php $app_id = 'YOUR_APP_ID'; $app_secret = 'YOUR_APP_SECRET'; $my_url = 'POST_AUTH_URL'; $code = $_REQUEST["code"]; //auth user if(empty($code)) { $dialog_url = 'https://www.facebook.com/dialog/oauth?client_id=' . $app_id . '&amp;redirect_uri=' . urlencode($my_url) ; echo("&lt;script&gt;top.location.href='" . $dialog_url . "'&lt;/script&gt;"); } //get user access_token $token_url = 'https://graph.facebook.com/oauth/access_token?client_id=' . $app_id . '&amp;redirect_uri=' . urlencode($my_url) . '&amp;client_secret=' . $app_secret . '&amp;code=' . $code; $access_token = file_get_contents($token_url); // Run fql query $fql_query_url = 'https://graph.facebook.com/' . '/fql?q=SELECT+uid2+FROM+friend+WHERE+uid1=me()' . '&amp;' . $access_token; $fql_query_result = file_get_contents($fql_query_url); $fql_query_obj = json_decode($fql_query_result, true); //display results of fql query echo '&lt;pre&gt;'; print_r("query results:"); print_r($fql_query_obj); echo '&lt;/pre&gt;'; // Run fql multiquery $fql_multiquery_url = 'https://graph.facebook.com/' . 'fql?q={"all+friends":"SELECT+uid2+FROM+friend+WHERE+uid1=me()",' . '"my+name":"SELECT+name+FROM+user+WHERE+uid=me()"}' . '&amp;' . $access_token; $fql_multiquery_result = file_get_contents($fql_multiquery_url); $fql_multiquery_obj = json_decode($fql_multiquery_result, true); //display results of fql multiquery echo '&lt;pre&gt;'; print_r("multi query results:"); print_r($fql_multiquery_obj); echo '&lt;/pre&gt;'; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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