Reputation: 41
I am using Facebook API to get the contact number and email id of friends, I worked on fbgraph and fql and uses all queries from https://developers.facebook.com/docs/reference/fql/, but in forum page of Facebook I found there is no way to get the contact number and email ID.
I also used the extended permission of the Facebook API but I didn't find anything.
If anyone know about it then please give the answer ...
Answer will be appreciated...
Upvotes: -1
Views: 697
Reputation: 2492
Make sure you have the "email" permission when the user authenticates
NSArray *permissions = [NSArray alloc] initWithObjects:@"permissions",nil];
[facebook authorize:permissions];
[permissions release];
Then, when the user has logged in, get the "me" from the graph:
[facebook requestFromGraph:@"me/" withDelegate:self];
You get the information from the "requestDidLoad" callback method:
if([result objectForKey:@"first_name"]){
// do stuff w/ user info
}
The id is:
[request objectForKey:@"id"];
Upvotes: 0
Reputation: 2511
If you use this code with the users access token
var url = "https://graph.facebook.com/me/?access_token=" + token;
var req = new XMLHttpRequest();
req.open("get", url, true);
req.send(null);
req.onerror = function () { alert("Error"); };
Then you will find the req.responseText has all the user information you are after. You can also get the user access token once they login.
Upvotes: 0