title: How can I get the names of the friends I send requests to using FB.ui({ method: 'apprequests'
body: <p>How can I get the names of the Facebook friends of the user? 
  I send requests to using <code>FB.ui({ method: 'apprequests'?</code><br>
  Here is my code:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input id="btSelectFriends" type="button" value="Select Friends" onclick="javascript:FBUISelectFriends()" /&gt;
    &lt;div id="fb-root"&gt;&lt;/div&gt;
    &lt;script  type="text/javascript" src="https://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
      function FBUISelectFriends() 
      {
        var selectedFriendsRequest_ids;
        FB.ui({ method: 'apprequests', message: 'Select friends', data: 'tracking information for the user', tite: 'Select friends' },
            function (response) {
              if (!response || !response.request_ids) { alert('Request could not be sent'); return; }
              selectedFriendsRequest_ids = response.request_ids;
              for (var i = 0; i &lt; selectedFriendsRequest_ids.length; i++) {
                FB.api('/me/apprequests/?request_ids=' + selectedFriendsRequest_ids[i].toString(),
                  function (response) {
                    if (!response || response.error) { alert('Friends Selection error occured'); return; }
                  }
                )
                FB.api(selectedFriendsRequest_ids[0],
                  function (response) 
                  {
                    alert(response.name);
                  }
                );
              }
            }
          );       
  
        return;
      }
    &lt;/script&gt;
  </code></pre>
  
  <p>I tried this code but it didn't work:</p>
  
  <pre><code>FB.api(selectedFriendsRequest_ids[0], function (response) {console.log(response.name);});
  </code></pre>
  
  <p>Can you please help?</p>
  
  <p>Thanks.</p>