0

有没有人能够通过 Koala 向 Facebook 订阅 Page Feed?我可以订阅用户喜欢、朋友、Feed 等以及页面照片、签到。但我无法让 Facebook 订阅并在 Page Feeds 上发回更新。这是我通过 Rails 控制台运行的内容(回发网址已更改)

updates.subscribe("page", "feed", "http://domain.com/facebook_updates", FacebookUpdatesController::VERIFY_TOKEN)
Koala::Facebook::APIError: OAuthException: (#100) "feed" is an invalid field name
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/koala-1.2.1/lib/koala/graph_api.rb:217:in `block in graph_call'
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/koala-1.2.1/lib/koala.rb:69:in `api'
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/koala-1.2.1/lib/koala/graph_api.rb:215:in `graph_call'
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/koala-1.2.1/lib/koala/realtime_updates.rb:62:in `subscribe'
    from (irb):66
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
    from /opt/ruby/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands.rb:40:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
4

1 回答 1

0

好吧……我想我又想通了。这是我更正的内容:

  1. 正确设置您的 Facebook 应用程序以供 Facebook 页面访问。请参阅教程http://www.hyperarts.com/blog/tutorial-add-an-iframe-application-to-your-facebook-fan-page-fall-2012/
  2. 您必须订阅“用户”、“提要”才能访问主页的提要数据。例子:

    更新.订阅(“用户”,“提要”,“http://domain.com/facebook_updates”,FacebookUpdatesController::VERIFY_TOKEN)

  3. Omniauth 必须具有适当的权限才能接收 Feed 实时更新。特别是我必须将“read_stream”添加到范围参数中。我正在将设计与 Omniauth 一起使用,这是 devise.rb 文件中的一个示例:

    config.omniauth :facebook, 'APP_ID', 'APP_SECRET', {:scope => 'publish_stream,email,offline_access,user_location,user_likes,user_interests,read_stream,manage_pages', :client_options => {:ssl => {:ca_file = > '/usr/lib/ssl/certs/ca-certificates.crt'}}}

我确实希望这可以帮助其他像我一样挣扎的人。

于 2012-01-11T16:55:29.427 回答