1

I am using Facebook SDK 3.16 for my application. Application registered before April 30th (2014), so I basically should have access to Graph Api v1.0. But when i login via application i can use only Graph Api v2+. I don't want it. How can I get access for Graph Api v1.0?

p.s. Via Graph Api Explorer all is ok. So i am confused

Ilnar Karimov
  • 339
  • 2
  • 6
  • 19
  • It is recommended to use Graph Api v2+ henceforth so you can prevent application to use deprecated methods – Mohd Mufiz Jan 21 '15 at 11:33
  • Even if there were a way to access the Graph API v1, which, personally, I no longer use, I wouldn't recommened using it. Apps using the older version can run until 30th April 2015 [_Source](https://developers.facebook.com/docs/graph-api)_. Upgrading before that deadline allows plenty of time to develop and test. – Siddharth Lele Jan 21 '15 at 11:36
  • @SiddharthLele i know it. But now i need to use only Graph API v1.0 – Ilnar Karimov Jan 21 '15 at 11:37
  • @user3104216: Again, it's never recommended using a _soon-to-obsolete API_. But if you really want to continue using it, this could part of the FB documentation might help: https://developers.facebook.com/docs/apps/versions#androidcalls. I simply don't have any code from the older API anymore to help you out. Besides your post is rather generic as against as specific code using the v1 API. – Siddharth Lele Jan 21 '15 at 11:44

1 Answers1

1

After several attempts, I found a solution for my problem.

If you are interested:

I had to get a list of friends.So i did like:

protected void getFacebookFriends() {
    new Request(
            session,
            "me/friends",
            null,
            HttpMethod.GET,
            new Request.Callback() {
                public void onCompleted(Response response) {
                    JSONObject json = null;
                    try {
                        json = new JSONObject(response.getRawResponse());
                        JSONArray jarray = json.getJSONArray("data");
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
    ).executeAsync();
}

It returned me all users who logged in my application.

So i simply added version Graph Api in Request like:

    new Request(
            session,
            "/v1.0/me/friends",
            null,
            HttpMethod.GET,
            new Request.Callback() {
                public void onCompleted(Response response) {
                    JSONObject json = null;
                    try {
                        json = new JSONObject(response.getRawResponse());
                        JSONArray jarray = json.getJSONArray("data");
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }
            }
    ).executeAsync();

And it returned list of all my friends ! But it works if your application registered before April 30th (2014) and it will deprecated at 30th April 2015

Ilnar Karimov
  • 339
  • 2
  • 6
  • 19