Android: Facebook Graph Api v1.0
Android: Facebook Graph Api v1.0
我正在为我的应用程序使用 Facebook SDK 3.16。申请是在4月30日(2014年)之前注册的,所以我基本上应该可以访问Graph Api v1.0。但是当我通过应用程序登录时,我只能使用 Graph Api v2+。我不想要它。如何获得 Graph Api v1.0 的访问权限?
p.s。通过 Graph Api Explorer 一切正常。所以我很困惑
经过多次尝试,我找到了解决问题的方法。
如果您有兴趣:
我必须得到一份 friends.So 我喜欢的清单:
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();
}
它返回了所有登录我的应用程序的用户。
所以我只是在 Request
中添加了版本图 Api,例如:
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();
它返回了我所有朋友的列表!但如果您的应用程序在 4 月 30 日(2014 年)之前注册并且它将在 2015 年 4 月 30 日弃用
我正在为我的应用程序使用 Facebook SDK 3.16。申请是在4月30日(2014年)之前注册的,所以我基本上应该可以访问Graph Api v1.0。但是当我通过应用程序登录时,我只能使用 Graph Api v2+。我不想要它。如何获得 Graph Api v1.0 的访问权限?
p.s。通过 Graph Api Explorer 一切正常。所以我很困惑
经过多次尝试,我找到了解决问题的方法。
如果您有兴趣:
我必须得到一份 friends.So 我喜欢的清单:
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();
}
它返回了所有登录我的应用程序的用户。
所以我只是在 Request
中添加了版本图 Api,例如:
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();
它返回了我所有朋友的列表!但如果您的应用程序在 4 月 30 日(2014 年)之前注册并且它将在 2015 年 4 月 30 日弃用