I want to know how i can access to my app data (title and description) when the user has access to it and get the localized values using the user locale.
My code is this:
var imageUrl = "http://ift.tt/1yih0QR",
userID = response.authResponse.userID,
userLanguage,
appTitle,
appDescription;
if (response.status === 'connected') {
FB.api(
"/" + userID,
function (response) {
if (response && !response.error) {
userLanguage = response.locale;
}
}
);
FB.api(
'me/{namespace}:{action}', 'post',
{
object: {
"url": imageUrl,
"title": appTitle,
"description": appDescription,
"image": imageUrl
}
},
function(response) {
}
);
} else if (response.status === 'not_authorized') {
FB.login( function( response ) {
}, {scope: "publish_actions"} );
} else {
FB.login( function( response ) {
}, {scope: "public_profile"} );
}
I tried to use this code, but the /me node returns the user data and i want to get the app data:
FB.api(
"/me",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Aucun commentaire:
Enregistrer un commentaire