Get user's email in FBConnect iphone sdk - email

do you know how to get in fbconnect the user email for iphone sdk?
I get uid, name and sex. But I can't get the email.
(void)session:(FBSession *)session didLogin:(FBUID)uid {
NSString *fql=[NSString stringWithFormat:#"select uid,name,sex,email,birthday from user where uid == %lld", uid];
http://developers.facebook.com/docs/guides/mobile/ here I don't see a solution.
thanks

The user needs to authorize the app to get the email.

In order to fetch user's email address, facebook requires developers to request "email" permission from the user and if the user grants the permission, you'll be able to fetch their email address.
There's a detailed documentation about the various types of permissions that your app can request from the user which enables your app to either read or write certain information on the user's behalf. Have a look:
https://developers.facebook.com/docs/reference/api/permissions/

Related

Get user photo with known email address from within iOS app

I want to automatically download user's profile photo from Facebook from within iOS app when an email is provided. I'm doing it by performing search to get user id.
The app will be used by many people, so there shouldn't be logged user, eventually app should authenticate itself.
My problem is getting access_token to do that. Similar solution is implemented in the Sparrow (email client for OSX and iOS).
My guess was to acquire an access_token by making request with this url:
[NSString stringWithFormat:#"https://graph.facebook.com/oauth/access_token?client_id=%#&client_secret=%#&grant_type=search", appId, appSecret];
but in return i'm getting this:
{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}
anyone knows how to solve this?
You need a user access token to be able to search by email address; see Find Facebook user (url to profile page) by known email address.

FB Connect API - cannot get friends email id

I'm developing an web application in Java and using facebook account for login to my applications. After sucessfull login i need to get the logged in facebook account user friend's details including email id's. I can get the logged in user's friend's profile details but not the email ids of them. It always shows null. How do i get the email ids of my facebook friends.
Any help is very much appreciated.
Currently, this is not supported by Facebook. You cannot get user's friends' email, regardless of what permissions the user gives your app. Refer to the this for details.

Getting another users email address in Facebook app

Am developing a system for an app to award points users for recruiting their friends. When the friend accepts the request I can retrieve the id of the person who invited them but can not find their email.
Have tried:
$fbInviter = $facebook->api("/$inviterId", 'GET');
$fbInvEmail = $fbInviter['email'];
but it appears ['email'] isn't in the returned array.
The app requests permission from each user when the first access it aswell as requesting offline access so permissions shouldn't be a problem.
Any ideas?
There is no way to get the email address for a Facebook user other than the current user, and the current user's address is only available if they've granted you the email extended permission

Facebook "Send me an email" permission

I prompted for the "email" permission in my Facebook application. However, when I access the graph api of the user, there is no field called "email" available even though I know they have an email on Facebook. Why?
As far as I know based on my experience with their API, Facebook does not offer access to the messaging framework, therefore you are not allowed to send messages on a user's behalf.
Is this for a test user where you know they accepted the permissions prompt and have an email?
How are you trying to get the email? I get them via FQL:
SELECT first_name, last_name, email from user where uid = {userid}

How to get email of a facebook friend in an iPhone app

I am developing an iPhone application that will send email to a logged in user friends'. I am using FacebookConnect for the same. The problem is I am getting the uid of all friends but what is the way to send email to these uids(friends UID).
Also I m not able to get the email id of any of the facebook friends.Can I get the emails of the users facebook friends in my iPhone App ?
Please help me out
Thanks
I don't think you can get email of friends. Although you can send an email to uids provided they have granted permission to you app.
A comma-separated list of recipient user IDs. The recipients must be people who have already authorized your application. You can email up to 100 people at a time.
Beyond general information you are require extended permissions which requires authentication (which you are using). Any extended permission works only with the user who has granted it to. So your app's user's friends will have to grant the permission to email before you can send them one. In other words, you can send a notification email to those friends of your user who have added your app and have granted you the permission to email. Facebook has this page on communicating via email.