Saturday, March 17, 2018

FB Graph application working one day not the next on /me response

Leave a Comment

I developed an application and it worked perfect, but today I get this error on /me request object using the JS API:

"unknown error (empty response)"

This is very odd to me and I'm finding it hard to debug. Everything was working as intended the other day but today I get this strange issue, no code changes have happened. Any suggestions on how I can debug this?

Just a standard (This is done after user successfully Auths on my application with correct scope):

 FB.api('/me', {fields: "email"}, function(response) {       console.log(response);        }); 

Result:

error_subcode: 1357045 message: "unknown error (empty response)"

As mentioned this worked as intended the other day. Now for some strange issue it's not working and the only error I get is that as mentioned above.

This is called after user auths on my app with whatever scope I require. As I mentioned this is very strange to me, nothing has changed at all on my side. Normally an object would be returned containing FB user ID and email.

1 Answers

Answers 1

I had the same error in the past days and after some tests I found out what was the problem for me.

Change this:

FB.api('/me', {fields: "email"}, function(response) {   console.log(response);       }); 

with this:

FB.api('/me', {fields: "id,email"}, function(response) {   console.log(response);       }); 

Seems that the field id is mandatory...however I haven't found any official resource about this, this is the result of self made test.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment