我正在尝试使用facebook api来获取朋友的关系状态:
FB.api("/me/friends", {
fields: "id, name, relationship_status, significant_other, picture.type(large)"
}, function (response) {
if (response.data) {
...
$.each(response.data, function (index, data) {
if (data.significant_other) {
// If has a significant other
} else {
// If do not have a significant other
}
});
}
});
我试着通过查看significant_other字段来确定朋友是否有重要的其他人。但我怎么知道我的朋友是否有重要的其他人但又不想透露?
答案 0 :(得分:1)
我有一个解决方案。如果relationship_status等于“在一个关系中”,但data.significant_other不在数据中。那意味着这位朋友有一个重要的,但不想透露。
答案 1 :(得分:0)
如果无法通过API访问数据,则无法通过API访问该数据
这几乎是一个重言式,但如果您可以访问这些数据,则可以通过您刚才包含的API调用获得该数据