Reputation: 21553
A lot of apps have this features where you get a notification when your facebook friend joins the app. I am wondering if this is via some special API? If not, how would I go about doing this?
I have thought about doing it like this: When a user signs up via facebook, I record their facebook ID and using graph API get all their facebook friends. Then when another user signs up via facebook, I check if any of the previous use have the new's user's fb id in their friends list, if so, I send a notification.
I am wondering if this is the way to do it or if there's some other way/API that is the norm. The downside to my way is that the friends list is not updated after they sign up and also I have to keep list of their friends in my database.. Thanks
Upvotes: 1
Views: 634
Reputation: 2759
Instead of fetching the users friends and comparing them to the users in your database, simply use this API call:
/{user_id}/friends?fields=installed
Of course you can add other fields to this list to get more data of the friends.
Upvotes: 1