Get a list of my friend's friends

懵懂的女人 提交于 2019-12-19 04:17:12

问题


I am building a small facebook app. In my app I am trying to get a list of my friend's friends. When I perfrom this I receive an error from facebook that I cannot select information about people that are not me (I was trying to retrieve my friend's friends )

Here is an example of what I mean:

User A - Uses the application
User B - Friend of user A and also uses the application

I want User A to be able to see a list of all of user's B friend's who are using the application as well.

Is there any way to get arround that? How can I do this?


回答1:


The way to get a list of friends for someone is by using the friends.get API method. However, webdreamer is correct in that you can't just pick any Facebook ID you want and start pulling out friend information for that person. The person you query about has to have authorized your application... otherwise any app developer could find out anything about anyone on Facebook, which would be a privacy nightmare.

It's tough to tell exactly what you want to do though, as your comments say you just want the friends of a user, and your original question says you want the friends of the friends. The first is possible... the second is not.

For the first, all you need to do is have someone add/authorize your app. After that, friends.get will work fine with that user's session key, which will be provided to your application, and you can get a list of their friends.



来源:https://stackoverflow.com/questions/1897749/get-a-list-of-my-friends-friends

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!