Search code examples
androidfacebookemailfacebook-graph-apiemail-address

Android - Email someone given a userid using Facebook Graph API?


I have an app that lets users search for items other users have put up for sale. I would like to be email to the owner/seller from the buyer using Facebook IDs. I'm using Android and the Facebook Graph API for my app. I have managed to get a user's email address after login (permissions etc all fine). Is it possible to then email another person using my app using their user ID from FB to get their email address?

So just to clarify - is there anyway to email a user ID that has given my application permission to get email address, if the logged in user ID/session isn't the one being emailed? Can I get a user's email address dynamically based on the User ID?

I realise it is unlikely and I'm most likely going to have to make some sort of Users table (I'm using Azure for a small DB) which stores an email address with the Facebook User ID, just wanted to check for sure though.


Solution

  • There is only one possibility: https://www.facebook.com/help/224049364288051

    People have to activate this one to make it work though, but you would need the username of the receiver. You can´t even get the username (or "real" ID) of the authorized user anymore, see changelog about "App Scoped IDs": https://developers.facebook.com/docs/apps/changelog

    Another reason why this is pointless: With /me/friends, you only get the users who authorized your App, and not ALL friends of the user. So you can just store the email of every user right when he authorizes your App.

    Btw, scraping is illegal on Facebook, don´t do that: https://www.facebook.com/apps/site_scraping_tos_terms.php