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
Then, once I invoke an API call, the function api() is executed, and here I found a problem
function api(obj) {
var method = obj.method || 'GET',
params = obj.params || {},
xhr = new XMLHttpRequest(), url;
console.log('tokenStore.fbAccessToken '+tokenStore.fbAccessToken); // here the token is present
// params = JSON.parse(JSON.stringify(obj)); // my solution
params['access_token'] = tokenStore.fbAccessToken;
console.log('access_token '+params['access_token'] ); // this is undefined !!!!!!
console.log('params '+JSON.stringify(params)); // this just contains the perms asked
....
}
So it seems that params['access_token'] = tokenStore.fbAccessToken; is not working. I solved cloning the object, so i becomes editable. params = JSON.parse(JSON.stringify(obj));
The text was updated successfully, but these errors were encountered:
De-Lac
changed the title
invalid token provided
invalid token provided [solved]
Apr 6, 2016
and... neither the fields selection worked for me. I had to change it.... now in openfb.js I have
function api(obj) {
var method = obj.method || 'GET',
fields = obj.fields || {},
xhr = new XMLHttpRequest(),
url;
// url = 'https://graph.facebook.com' + obj.path + '?' + toQueryString(params); // as was before
url = 'https://graph.facebook.com' + obj.path + '?'
+"fields=" + fields
+"&access_token=" + tokenStore.fbAccessToken;
console.log('openfb '+url); // try to open it in a browser to test
I was stuck for days on this issue... I managed to login, but at the first API call ( /me for example), I got the error "
Finally I found the solution. I consider it strange that it seems that just me I got this error.
By the way, the problem is in the
openfb.js
library.During the login, I store the obtained access_token in a variable
Then, once I invoke an API call, the function api() is executed, and here I found a problem
So it seems that
params['access_token'] = tokenStore.fbAccessToken;
is not working.I solved cloning the object, so i becomes editable.
params = JSON.parse(JSON.stringify(obj));
The text was updated successfully, but these errors were encountered: