I need help to implement Facebook login within my application. I tried the official Cordova plugin example but I could not make it work, I need to retrieve the username,email and gender. If anyone has implemented this before I will appreciate your help.
Thank you
What I have tried:
<script>
var login =function(){
facebookConnectPlugin.login(["email"],
function (response) {
apiTest(response.authResponse.accessToken)
},
function (response) { alert(JSON.stringify(response)) });
}
var apiTest = function (token) {
facebookConnectPlugin.api("me/?
fields=id,name,email,gender&access_token=" +token,
function (response) { alert(response.email + " " +response.name) },
function (response) { alert(JSON.stringify(response)) });
}
</script>