Question:

In my application, there is an "Let's join the game!" function. For this function, I plan to allow users to send out app requests to their friends that have not used the app before. I have tried to use the FB.ui function in the JavaScript SDK to display the app requests dialog. However, all the user's friends are there. Is there a way that I can filter the friend list?

 

 

Answer:

Appreciate if you can like this page if you find it useful! - Click "Like"

In order to display only the user's friends that have not yet authorized the app, get the list of the users who are friends of the current user and have authorized your application. Then include them all in the "exclude_ids" parameter for the app requests dialog. By doing this, those users that have authorized your app won't be shown up.

For how to et the list of the users who are friends of the current user and have authorized your application, you can do this, say via FQL or Old REST API. For example, see the FAQ How to get a list of the users who are friends of the current user and have authorized my application?.

 

Find my FAQ on Facebook Development useful? Download the PDF for all the FAQs HERE!