I have installed the cordova inapp browser plugin to add the social facebook login. Thing is, in my app i have allowed only sign in through facebook and not sign up. On my webapp if that user has been registered then only he/she can access the mobile app. So to do the signin from mobile app, after callback is it possible to receive the email id which user provided in the inapp browser that opens on facebook button click? If i reveive email id the i can cross verify his/her existence in database? Is it possible to do that?
My code is this:
$scope.getDeviceInfo = function() {
$cordovaOauth.facebook("777846192309223", ["email"]).then(function(result) {
alert('success login:'+JSON.stringify(result));
}, function(error) {
alert('error: '+error);
});
}
In the above the email
in the argument is the user data i want to get from facebook on successful login. But i am getting access_token
that is somewhat around 50 digit and another one parameter expires_in
with timestamp of 7 digits. I am not getting email here. How to get that?
Store the access token to localstorage. And using facebook graph api to get user email id and etc