This question is an extended version of Facebook. Updated in real time does not call our servers , which seems dead. In addition, Realtime updates the internal server error on Heroku using Koala , it does not help, because I subscribe to the heroku console, as pjaspers suggested.
I have an application ( ruby 1.9.2p290and Rails 3.1.3) that connects to facebook to get the data from the current user. Everything works fine with koala gem (v1.2.1), but I check the fb servers every time users log in. I would like to use real-time updates on facebook, and I read the following:
I installed the system in test mode and successfully deployed to the hero. I can subscribe to the user object and I get a GET request to my server, but there is no POST with updated information received from facebook . If I send POST to my server manually, everything will work.
Additional information: routes.rb
get '/realtime' => 'realtime#verify'
post '/realtime' => 'realtime#change'
generating
realtime GET /realtime(.:format) {:controller=>"realtime", :action=>"verify"}
POST /realtime(.:format) {:controller=>"realtime", :action=>"change"}
Controller (breadboard version, only to check if it works):
class RealtimeController < ApplicationController
def verify
render :text => params["hub.challenge"]
end
def change
puts params.inspect
render :nothing => true
end
end
Subscription from heroku console:
irb(main):004:0> @updates = Koala::Facebook::RealtimeUpdates.new(:app_id => ENV['FACEBOOK_APP_ID'], :secret => ENV['FACEBOOK_APP_SECRET'])
=>
irb(main):005:0> @updates.list_subscriptions
=> [{"object"=>"user", "callback_url"=>"http://blah-blah-0000.herokuapp.com/realtime", "fields"=>["education", "email", "friends", "name", "website", "work"], "active"=>true}]
I do not know what to do next...
- Perhaps I am not triggering the correct event changes?
- ? ( , )
- - ?
- - ?
- Facebook? ?
:)