We are using Facebook Graph API v2.9 to run "feed balancing" application: Like What You Hate
The app runs React served from a NodeJs server.
The app was running fine a few months ago (Dec. 2017) when we made some updates but we recently discovered that the app had stopped working.
Upon investigation I found that when I hit the following endpoints:
/me/picture?height=80&width=80
/me/picture
/{a-defined-user-id}/picture
graph api is returning the following error in the response:
{
"error": {
"code": 1,
"error_subcode": 1357046,
"message": "Received Invalid JSON reply.",
"type": "http"
}
}
Other endpoints, such as:
/me
/me/likes
/me/likes?limit=1000
return a JSON object as expected.
I've used the Graph API Explorer to hit the /me/picture endpoint and I get what seems to be a valid JSON response.
So it seems to be something with the SDK code. We are using the Javascript SDK and mounting it in our app thusly:
window.fbAsyncInit = function() {
window.FB.init({
appId : fbAppId,
xfbml : true,
version : 'v2.9',
cookie : true
});
window.FB.AppEvents.logPageView();
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = '//connect.facebook.net/da_DK/sdk.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
One thing to note is that we are getting the Danish SDK (da_DK) servers, but I have also tried the US version (en_US) and saw the same issue.
Was just able to resolve this issue by modifying the endpoint URL, per the latest on the bug report.
change: /{USER_ID}/picture
to: /{USER_ID}/picture?redirect=false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With