【问题标题】:Unable to get feeds from the facebook using koala for rails 4无法使用 koala for rails 4 从 facebook 获取提要
【发布时间】:2016-03-06 15:17:35
【问题描述】:

您好,我正在使用Koala gem 和图形 API 来获取 Facebook 信息。

这里是示例实现

def facebook_profile            
    a_token = current_user.facebook_oauth_setting.access_token
    @graph = Koala::Facebook::API.new(a_token)
    @picture = @graph.get_picture("me")
    @feed = @graph.get_connection('me', 'posts', {fields: ['id', 'message']})
end

当我尝试这个时,我得到了以下结果

{"name"=>"Firstname Lastname", "id"=>"1053124034660975"}

但没有收到任何供稿或帖子。

我参考了以下链接

https://github.com/arsduo/koala/wiki/Graph-API#getting-public-data

但遇到同样的问题。

还检查了 facebook 上的权限,但遇到了同样的问题。

那么我怎样才能从 facebook 获取提要,或者有什么我遗漏的东西。

【问题讨论】:

    标签: ruby-on-rails facebook facebook-graph-api koala koala-gem


    【解决方案1】:

    通常您必须先获得用户的许可才能阅读他的信息。根据文档https://developers.facebook.com/docs/graph-api/reference/v2.5/user/feed你需要获得user_posts权限

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-14
      • 1970-01-01
      • 2015-03-09
      • 2016-07-14
      • 2016-05-15
      • 1970-01-01
      • 2015-06-15
      • 1970-01-01
      相关资源
      最近更新 更多