简体   繁体   中英

How to fetch fields that require access token using fbgraph

I am trying to fields that require access token, fields like age_range, here are the list of fields

https://developers.facebook.com/docs/reference/api/user/

user = FbGraph::User.new('me', :access_token => access_token).fetch

I am trying

 user.age_range #=> nil

Where as when i am trying in facebook graph api explorer using http://developers.facebook.com/tools/explorer

facebook_id?fields=age_range

It shows the Json data for the same user.

是否使用omniauth,添加了具有范围的info_fields

provider :facebook, facebook_app_id, facebook_secret_key, { :info_fields => 'age_range', :scope => 'email,offline_access' }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM