我正在编写一个应用程序,我在其中获取 Facebook 好友列表以及他们的姓名、个人资料照片和生日,以便我使用以下查询:
String query = "SELECT name, birthday, uid, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) ORDER BY birthday_date ASC";
并且我已授予这些权限:
String[] facebook_permissions = { "user_photos", "user_birthday",
"friends_birthday", "friends_photos", "read_stream",
"offline_access" };
但现在我也想显示我 facebook 好友的年龄,我想我应该使用它
age_range
我也试图通过使用下面的查询来获取 facebook 好友的年龄,但我用 null 代替年龄:
String query = "SELECT name, birthday, uid, pic_square, age_range FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) ORDER BY birthday_date ASC";
最佳答案
年龄范围不是一个人的年龄,而是facebook documentation说:
containing min and max for the age range; Possible age ranges are 13-17, 18-20, and 21+; max is not set if the age is 21+
你为什么不计算老 friend 使用生日和今天日期的次数?这可以使用 native 日历以非常简单的方式完成。
我建议您也使用新的 facebook API。
关于facebook - 如何在 Android 中获取 Facebook 好友年龄,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15377511/