Note that there are some explanatory texts on larger screens.

plurals
  1. PONo POST from facebook using real-time updates in Rails, Heroku and Koala
    primarykey
    data
    text
    <p>This question is an expanded version of <a href="https://stackoverflow.com/questions/7562397/facebook-real-time-updated-does-not-call-our-servers">Facebook Real-time updated does not call our servers</a>, that seems to be dead. Also, <a href="https://stackoverflow.com/questions/7666411/realtime-updates-internal-server-error-on-heroku-using-koala">Realtime updates internal server error on Heroku using Koala</a> is not helpful because I'm subscribing from the heroku console as <em>pjaspers</em> suggested.</p> <p>I have an app (<code>ruby 1.9.2p290</code> and <code>Rails 3.1.3</code>) that connects to facebook to get data from the current user. Everything is working ok with the koala gem (v1.2.1), but I'm polling the fb servers every time the users logs in. I would like to use facebook real-time updates, and I have read the following:</p> <ul> <li>Koala manual on fb realtime updates: <a href="https://github.com/arsduo/koala/wiki/Realtime-Updates" rel="nofollow noreferrer">https://github.com/arsduo/koala/wiki/Realtime-Updates</a></li> <li>Facebook page on realtime: <a href="https://developers.facebook.com/docs/reference/api/realtime/" rel="nofollow noreferrer">https://developers.facebook.com/docs/reference/api/realtime/</a></li> </ul> <p>I have set up the system in test mode and deployed to heroku successfully. I can subscribe to the user object and I get the GET request to my server, but <strong>no POST with updated information is ever received from facebook</strong>. If I issue a POST to my server manually everything works.</p> <p>More information: routes.rb</p> <pre><code> get '/realtime' =&gt; 'realtime#verify' post '/realtime' =&gt; 'realtime#change' </code></pre> <p>generating </p> <pre><code> realtime GET /realtime(.:format) {:controller=&gt;"realtime", :action=&gt;"verify"} POST /realtime(.:format) {:controller=&gt;"realtime", :action=&gt;"change"} </code></pre> <p>The controller (mock version, only to test if it's working):</p> <pre><code>class RealtimeController &lt; ApplicationController def verify render :text =&gt; params["hub.challenge"] end def change puts params.inspect render :nothing =&gt; true end end </code></pre> <p>The subscription from the heroku console:</p> <pre><code>irb(main):004:0&gt; @updates = Koala::Facebook::RealtimeUpdates.new(:app_id =&gt; ENV['FACEBOOK_APP_ID'], :secret =&gt; ENV['FACEBOOK_APP_SECRET']) =&gt; #&lt;Koala::Facebook::RealtimeUpdates:0x00000004f5bca8 @app_id="XXXXXXX", @app_access_token="XXXXXXX", @secret="XXXXXXX", @graph_api=#&lt;Koala::Facebook::API:0x00000004a8d7a8 @access_token="XXXXXXX"&gt;&gt; irb(main):005:0&gt; @updates.list_subscriptions =&gt; [{"object"=&gt;"user", "callback_url"=&gt;"http://blah-blah-0000.herokuapp.com/realtime", "fields"=&gt;["education", "email", "friends", "name", "website", "work"], "active"=&gt;true}] </code></pre> <p>I don't know what to do next...</p> <ul> <li>Maybe I am not triggering the correct changing events?</li> <li>How do I see the list of users of my app? (right now it's a test app and the only user would be me)</li> <li>Anyone with this kind of issue?</li> <li>Is something wrong in the code?</li> <li>Is facebook down? Is it the end of Internet?</li> </ul> <p>Thank you for the help :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload