我正在使用 Facebook Android Developers Hackbook 示例,我想知道如何获取 Facebook 好友即将到来的生日,例如:今天 27 岁,10 天后 28 岁等等,使用GraphAPI
或FQL
public class graphApiRequestListener extends BaseRequestListener {
@Override
public void onComplete(final String response, final Object state) {
dialog.dismiss();
// access token is appended by Facebook object, hence params are
// added here after request is complete
if (!params.isEmpty()) {
url += "?" + Util.encodeUrl(params); // Params
}
metadataObject = null;
params.clear();
try {
JSONObject json = Util.parseJson(response);
if (json.has("metadata")) {
metadataObject = json.getJSONObject("metadata");
json.remove("metadata");
} else {
metadataObject = null;
}
setText(json.toString(2));
} catch (JSONException e) {
setText(e.getMessage());
e.printStackTrace();
} catch (FacebookError e) {
setText(e.getMessage());
e.printStackTrace();
}
}