You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setup this: FacebookInAppBrowser.settings.permissions = 'email, public_profile'.
I have this code but I cannot see on alert the email of user to use it on my register process :
function get_user_fb(){
FacebookInAppBrowser.getInfo(function(response) {
if(response) {
var name = response.name;
var id = response.id;
var gender = response.gender;
//mail = response.email;
alert(JSON.stringify(response));
// check the response object to see all available data like email, first name, last name, etc
//console.log(JSON.stringify(response));
}
else{
alert('No se puede coger ese get');
}
});
}
$(document).ready(function(){
if(localStorage.getItem('accessToken') != null || localStorage.getItem('accessToken') != undefined){
FacebookInAppBrowser.getInfo(function(response) {
if(response) {
var name = response.name,
id = response.id,
gender = response.gender;
// check the response object to see all available data like email, first name, last name, etc
$('#register').hide(500, function(){
$('#welcome').show(500, function(){
$('.your_name').html(name);
});
});
console.log(JSON.stringify(response));
}
});
}
$(document.body).on("click",".btn-register", function(){
rytmus.pushPage("home.html", { animation :'slide'});
});
$(document.body).on("pageinit","#inicio", function() {
});
$('.btn-register-fb').click(function(){
FacebookInAppBrowser.login({
send: function() {
console.log('login opened');
},
success: function(access_token) {
console.log('done, access token: ' + access_token);
},
denied: function() {
console.log('user denied');
},
timeout: function(){
console.log('a timeout has occurred, probably a bad internet connection');
},
complete: function(access_token) {
console.log('window closed');
if(access_token) {
console.log(access_token);
} else {
console.log('no access token');
}
},
userInfo: function(userInfo) {
if(userInfo) {
$('#register').hide(200, function(){
$('#welcome').show(200, function(){
//$('.your_name').html(userInfo.name);
//graph.facebook.com/{{fid}}/picture
$('#img_fb').attr('src', 'https://graph.facebook.com/'+userInfo.id+'/picture');
});
});
alert(JSON.stringify(userInfo));
console.log(JSON.stringify(userInfo));
} else {
alert('No se puede acceder a tu información desde Facebook');
console.log('no user info');
}
}
});
});
});
get_user_fb();
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Please download the .js file again and update your phonegap.facebook.inappbrowser.js. I just updated the function with additional arguments to make it work.
Hi,
I have setup this: FacebookInAppBrowser.settings.permissions = 'email, public_profile'.
I have this code but I cannot see on alert the email of user to use it on my register process :
});
});
});
Thanks in advance.
The text was updated successfully, but these errors were encountered: