I am on a project that involve facebook integration.
Following the http://developers.facebook.com/docs/guides/mobile i am able to integrate the sdk into my application and it runs pretty smooth as well.
Its like a portal where i just need to enter my facebook credential and it will open the facebook content for me within my app screen.We cant manipulate anything from here.
What i want a way to enter my facebook credentials and retrieve my all friends email addresses as list which i can use in my application as i want.like displaying them in a ListView
Like the yahoo.com which on asking facebook credentials , saves a csv file on to the desktop that has all the list of friends addresses. That means facebook do allow retrieval of friends email after proper authentication.
I tried FBRocket as well. it didnt seem to work…
How to programatically achieve this.
In order to acces the facebook graph api you’ll need to use their SDK. You can download it from here https://github.com/facebook/facebook-android-sdk. They provide you with a dialog box for the user to enter their user and password and obtain an oauth token. Then using the Facebook object you can request anything on the graph path API. As with the example they give you can use something similar to show the login dialog.
Your friends list can be accessed using the graph path of /me/friends.
This should return something that looks like the following
You can then access each user using their id and the open graph api to retrieve their email if it’s visible to you.
This will give you back a json array that contains your friends IDs. You can then cycle through each of the friends and retrieve their information if it’s available to you.