Graph API: how to search for friends using the keyword

I need to provide a search option for my friends. If I use "me / friends", he will list all my friends. If I use "search? Q = keyword", I will get search results that contain no friends.

This is their way of finding FB users, who is my friend?

+4
source share
1 answer

Probably the easiest way is to use code through FQL like this:

SELECT name, about_me FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND ( strpos(lower(name), lower([SEARCH])) >= 0 OR strpos(lower(about_me), lower([SEARCH])) >= 0 ) 
+5
source

All Articles