根据Facebook文档,age_range是请求用户数据时的默认属性:
https://developers.facebook.com/docs/facebook-login/permissions#reference-basic-info
https://developers.facebook.com/docs/facebook-login/permissions#reference-basic-info
当我使用“me”作为具有正确令牌的用户ID时,这确实有效:
07001 for required user]
{ "id": "FACEBOOKID","name": "testuser","email": "testuser\u0040test.net","first_name": "testuser","last_name": "testuser","gender": "male","age_range": { "min": 21 },"picture": { "data": { "url": "https://...","is_silhouette": false } } }
但是当我使用用户ID时,data_range为空:
07002*
给我回复:
{ "id": "FACEBOOKID","first_name": "tftestuser","last_name": "tftestuser","picture": { "data": { "url": "http://....","is_silhouette": true } } }
知道为什么吗?我在这里错过了什么?
先感谢您!
解决方法
我在这里找到了一个使用API的答案:
no age_range in facebook response (javascript sdk)
no age_range in facebook response (javascript sdk)
api调用“/ me”返回默认信息,该信息并不总是包含age_range.
但是你可以通过api调用请求age_range:“/我吗?田= AGE_RANGE”