我目前可以使用Facebook Graph API从1个用户ID中获取个人资料图片。假设我有300个用户,那么我必须向Facebook SDK发出300个请求。
有没有办法在单个请求中执行此操作?
这是我到目前为止所做的:
private void requestPicture(String id) {
GraphRequest.newGraphPathRequest(
AccessToken.getCurrentAccessToken(),
String.format("/%s/picture?type=large&redirect=false", id),
(GraphResponse response) -> {
String pictureUrl = JsonPath.read(response.getJSONObject().toString(), "$.data.url");
}).executeAsync();
}
我需要一个像这样的方法:
private void requestPictures(List<String> ids){...}
这是我到目前为止所尝试的,但我收到了错误some of the aliases you requested do not exist: {id1,id2}
。当然我使用了有效的ID:
"/picture?ids={id1,id2}&type=large&redirect=false"