Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook (OAuthException - #100) Tried accessing nonexisting field (first_name) on node type (AnonymousUser)

I've been using Facebook login in my app for a while without any issues. We did a big update to our website and now I keep getting this error from some users, and only in our Android cordova app

(OAuthException - #100) (#100) Tried accessing nonexisting field (first_name) on node type (AnonymousUser)

I can't reproduce the error, tried many different things, with Facebook app installed or not, different users, different phones.

I'm using this code in C# to get the user

var fb = new Facebook.FacebookClient(accessToken);
fb.Version = "v2.8";
dynamic me = fb.Get("me?fields=first_name,last_name,id,email, gender");

But if I do this

dynamic me = fb.Get("me?fields=id");

Then it works and gives me an id, but I thought first_name and last_name were always available.

I can't see anything in our update that would break this and I can't figure how the token would be for a AnonymousUser. How can you get such a token?

Edit Here is the cordova login code

facebookConnectPlugin.login(
    ["email"], // array of permissions
    function (response: any) { ... },
    function (response: any) { ... }
);
like image 510
Christian Lavallee Avatar asked Oct 17 '22 17:10

Christian Lavallee


1 Answers

I got the same problem too, someone reported to facebook https://developers.facebook.com/bugs/173424853153369/

like image 137
Andy Cheung Avatar answered Oct 20 '22 10:10

Andy Cheung