FB.API simple requests failing

175 views Asked by At

Calling

FB.Init(InitFinished, "myappid");

Doing a simple login like this:

FB.Login("user_friends", facebookLogin );

Everything works, get a token back, and i can even use that token successfully in the Graph API Explorer for the same calls

Here's the call from code:

FB.API ("v2.3/me/friends", Facebook.HttpMethod.GET, delegate(FBResult r)...

But in the app, I get this error:

You are trying to load data from a www stream which had the following error when downloading. java.io.FileNotFoundException: https://graph.facebook.com/me

My app has been live for 2 years and aside from occasional FB updates to migrate to newer API versions, nothing's really changed. I added a canvas URL (since it seems to need that now), key hash is correct. What am i missing?

EDIT:

Here's the code around the call:

WWWForm frm = new WWWForm();
frm.AddField("fields", "id,picture.width(100),name");
frm.AddField("limit", "50");
FB.API("me", Facebook.HttpMethod.GET, delegate(FBResult r) {
    if (r.Error == null) {
         Debug.Log("fb me request came back: "+r.Text);
    } else {
         Debug.Log ("fb me failed with error: " + r.Error);
    }
}, frm);
1

There are 1 answers

0
Klaus Rubba On

Ugh, looks like the problem was passing in a WWWForm to a GET request. I mostly copied the code from a project using prime31 social plugin, and while it takes a hashtable instead of WWWForm, it appears to be smart enough to take the params out and use them as query params on the GET. Would be nice if FB SDK did the same, or at least give a meaningful error...