To fetcht the user detail from facebook like name,first_name,last_name,middle_name,gender etc use the code below :
func fetchUserDetails(useid: String,accessToken:String)
{
let graphRequest : FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"email,name,first_name,last_name,middle_name,gender,birthday,education,timezone,picture"])
graphRequest.startWithCompletionHandler({ (connection, result, error) -> Void in
if ((error) != nil)
{
// Process error
print("Error: \(error)")
}
else
{
print(result)
}
})
}
0 Comment(s)