Hey everyone!
I’m working on an Android app and I need to show a list of the user’s Facebook friends. I’ve been looking at the Facebook SDK but I’m not sure where to start. Can anyone give me a quick rundown of the steps I need to follow?
I’m pretty new to this, so any tips or code snippets would be super helpful. I’ve heard there might be some permissions I need to ask for, but I’m not sure which ones.
Also, is there a way to filter the list or only show certain types of friends? Like maybe just the ones who also use my app?
Thanks in advance for any help you can give me!
I’ve implemented this feature in a recent project. Here’s what you need to know:
The process isn’t straightforward due to Facebook’s privacy policies. You can only retrieve friends who have also authorized your app, not the user’s entire friend list.
Start by integrating the Facebook SDK and handling login. Then, use a GraphRequest to fetch friend data. The key is using the correct Graph API endpoint and parameters.
Be aware that the ‘user_friends’ permission is now restricted. You’ll need to submit your app for review before you can access this data in a live environment.
For filtering, you’ll need to handle that on your end after retrieving the data. Facebook doesn’t provide built-in filtering options for friend lists.
Let me know if you need more specific guidance on implementation.
As someone who’s gone through this process, I can tell you it’s not as straightforward as it used to be. Facebook has tightened up their privacy policies quite a bit.
First off, you’ll need to integrate the Facebook SDK into your Android project. Once that’s done, you’ll need to handle the login process and request the ‘user_friends’ permission. But here’s the catch - you’ll only be able to see friends who have also authorized your app.
To actually fetch the data, you’ll use a GraphRequest. The endpoint you’ll want is ‘/me/friends’. Remember to handle the response asynchronously.
One thing to keep in mind - if you’re planning to publish your app, you’ll need to get it reviewed by Facebook before you can access friend data in a live environment. They’re pretty strict about this.
As for filtering, you’ll have to implement that yourself after you get the data. Facebook doesn’t provide built-in filtering options for friend lists.
Hope this helps! Let me know if you need more details on any part of the process.
hey mate, i’ve actually done this before. first, make sure u have the latest FB SDK. then, u gotta request the ‘user_friends’ permission when logging in. use GraphRequest to fetch friends data. BUT heads up - it’ll only show friends who also use ur app. FB’s privacy rules n all. lemme kno if u need more help!