Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app -


i trying friend name , ids graph api v2.0, data returns empty:

{   "data": [   ] } 

when using v1.0, ok following request:

fbrequest* friendsrequest = [fbrequest requestformyfriends];   [friendsrequest startwithcompletionhandler: ^(fbrequestconnection *connection,                                                 nsdictionary* result,                                                 nserror *error) {       nsarray* friends = [result objectforkey:@"data"];       nslog(@"found: %i friends", friends.count);       (nsdictionary<fbgraphuser>* friend in friends) {           nslog(@"i have friend named %@ id %@", friend.name, friend.id);       }   }]; 

but cannot friends!

in v2.0 of graph api, calling /me/friends returns person's friends use app.

in addition, in v2.0, must request user_friends permission each user. user_friends no longer included default in every login. each user must grant user_friends permission in order appear in response /me/friends. see the facebook upgrade guide more detailed information, or review summary below.

if want access list of non-app-using friends, there 2 options:

  1. if want let people tag friends in stories publish facebook using app, can use /me/taggable_friends api. use of endpoint requires review facebook , should used case you're rendering list of friends in order let user tag them in post.

  2. if app game , game supports facebook canvas, can use /me/invitable_friends endpoint in order render a custom invite dialog, pass tokens returned api the standard requests dialog.

in other cases, apps no longer able retrieve full list of user's friends (only friends have authorized app using user_friends permission). this has been confirmed facebook 'by design'.

for apps wanting allow people invite friends use app, can still use send dialog on web or new message dialog on ios , android.

update: facebook have published faq on these changes here: https://developers.facebook.com/docs/apps/faq explain options available developers in order invite friends etc.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -