We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am running this in my app built with phonegap:
`function handleFbLogin() { openFB.login( function(response){ alert(JSON.stringify(response)); if (response.status == 'connected') { getUsersData(response.authResponse.accessToken); }else{ // Login cancelled by the user. alert('Login With Facebook Cancelled'); } }, { scope: 'email' // for more permissions see https://developers.facebook.com/docs/facebook-login/permissions } ); }
function getUsersData(token) { openFB.api({ path: "/me?fields=email&access_token='"+token+"'", //path: '/me?access_token=' + token, success: function(f) { // f is an object /* { id: "123456789", // Facebook User Id birthday: "06/10/1394", email: "[email protected]", // Facebook User Email first_name: "Mark", // Firstname gender: "male", // Gender last_name: "openfb", // Last name link: "https://www.facebook.com/app_scoped_user_id/123456789/", locale: "en_US", name: "Mark openfb", timezone: 1, updated_time: "2014-04-15T60:48:21+0000", verified: true, // If user is verified website: "openfb.com" } */ alert(JSON.stringify(f)); // Mark openfb }, error: function(e) { alert(JSON.stringify(e)); } }); }`
It says the token is invalid or malformed no matter what I do :/ How do I pass the access token correctly and why isn't that documented?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am running this in my app built with phonegap:
`function handleFbLogin()
{
openFB.login(
function(response){
alert(JSON.stringify(response));
if (response.status == 'connected') {
getUsersData(response.authResponse.accessToken);
}else{
// Login cancelled by the user.
alert('Login With Facebook Cancelled');
}
}, {
scope: 'email' // for more permissions see https://developers.facebook.com/docs/facebook-login/permissions
}
);
}
function getUsersData(token)
{
openFB.api({
path: "/me?fields=email&access_token='"+token+"'",
//path: '/me?access_token=' + token,
success: function(f) {
// f is an object
/*
{
id: "123456789", // Facebook User Id
birthday: "06/10/1394",
email: "[email protected]", // Facebook User Email
first_name: "Mark", // Firstname
gender: "male", // Gender
last_name: "openfb", // Last name
link: "https://www.facebook.com/app_scoped_user_id/123456789/",
locale: "en_US",
name: "Mark openfb",
timezone: 1,
updated_time: "2014-04-15T60:48:21+0000",
verified: true, // If user is verified
website: "openfb.com"
}
*/
alert(JSON.stringify(f)); // Mark openfb
},
error: function(e) {
alert(JSON.stringify(e));
}
});
}`
It says the token is invalid or malformed no matter what I do :/
How do I pass the access token correctly and why isn't that documented?
The text was updated successfully, but these errors were encountered: