I am using interested in obtaining the following info from a user's fb profile :
- name
- profile picture link
- age
To do so I use the following code:
let accessToken = FBSDKAccessToken.currentAccessToken()
let req = FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"picture.redirect(false),email,name,gender,age_range,birthday"], tokenString: accessToken.tokenString, version: nil, HTTPMethod: "GET")
req.startWithCompletionHandler({ (connection, result, error : NSError!) -> Void in
if(error == nil)
{
print("result \(result)")
}
else
{
print("error \(error)")
}
}) }
This returns:
result {
"age_range" = {
min = 21;
};
email = "dedewdd@gmail.com";
gender = male;
id = xxxxxxxxxxxx;
name = "John Smith";
picture = {
data = {
"is_silhouette" = 0;
url = "https://scontent.xx.fbcdn.net/v/t1.0-1/p50x50/dwqdwddqwdwqdw";
};
};
}
The problem with this is that this image is 50X50 pixels, I would like to obtain a link to a larger image.