I've used the Javascript SDK to use Facebook login, but now I'm connected, I don't know how to capture the user's data and send it on a codeigniter controller. I decided to use ajax, but I don't know how to implement it if I still don't have my facebook userdata.
if (response.status === 'connected') {
//How do I get userdata??
// I decided to use ajax
$.ajax({
type : 'POST',
data : 'userdata='+ //but I don't know how I would put my data,
url : '<?php echo site_url("somecontroller/somefunction");?>',
success : function(){
}
});
}
Also, how do I get the data to be placed in an array so I could just use 1 variable when sending it to my controller?
After you verify if user is connected you access facebook api for curent user :
Although, if u want to get more details than public data, u have to get the user permission using FB.login