I would like to retrieve Facebook friends list and use it in my application, to post on friend’s wall.
But I have a problem, the first time the user authorises my app to connect with the user’s facebook, I retrieve the user’s friend list and store the facebook id in my data.
I then use the friends list in my data, within my application to post on friend’s wall etc
But if the user are no longer friends, (ie not in the user’s friend list) the application will not be able to post on friends wall.
How do I keep my app in sync? Do I have to retrieve the friends list to check if user is still friends, everytime I want to post to friends wall? (it might be a problem when the user has too many friends? 5000+ friends? )
The most efficient method would be to store the users friends list. You can then use real-time updates (see: https://developers.facebook.com/docs/reference/api/realtime/) to subscribe to changes in data. Whenever a change occurs, Facebook makes an HTTP POST to an endpoint you specify (e.g. foo.php) with a list of changes (e.g. user_id, id, etc.). The graph API is very well documented, so I would highly suggest you read through the link referenced above. Best of luck!