如何在Android中使用Hackbook示例应用程序获取Facebook好友生日, 仅获取名称和图像.....
答案 0 :(得分:0)
尝试此查询:(使用FQL。我从未测试过等效的Graph API,也不确定是否可能)
String queryBirthdays = "SELECT uid, name, birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) AND birthday_date >= '01/03' AND birthday_date <= '06/03' ORDER BY birthday_date ASC";
Bundle bunEvents = new Bundle();
bunEvents.putString("method", "fql.query");
bunEvents.putString("query", queryBirthdays);
String responseEventsQuery = Utility.mFacebook.request(bunEvents);
然后解析responseEventsQuery
。例如,像这样:
JSONArray JAEvents = new JSONArray(responseEventsQuery);
for (int i = 0; i < JAEvents.length(); i++) {
JSONObject JOEvents = JAEvents.getJSONObject(i);
}
注意:您可能需要在查询中使用这些参数:01/03
和06/03
以获得必要的结果。尝试Graph API Explorer(在FQL查询选项卡中)