Facebook RealTime is a rails wrapper around facebook Real-time Update API.
developers.facebook.com/docs/api/realtime
For an overview of what this is all about, see developers.facebook.com/docs/api.
Controller must inherit FacebookRealTime::SubscriptionsController
-
facebook_check is a callback URL to which Facebook will get subscription validation.
-
facebook_update is callback URL to which Facebook will post subscription updates.
open your routes.rb and add
-
match ‘/endpoint’ => ‘controller_name#facebook_check’, :via => [:get]
-
match ‘/endpoint’ => ‘controller_name#facebook_update’, :via => [:post]
-
FB : facebook application id
-
FB : facebook application secret
-
FB : A subscriber-provided opaque token that will be echoed back in the verification request to assist the subscriber in identifying which subscription request is being verified. If this is not included, no token will be included in the verification request. This is from the PubSubHubbub spec.
Before using gem you have to deploy a valid check method, to add new subscriptions
Use rake tasks :
-
rake fb:rt:list to show your subscriptions
-
rake fb:rt:delete to delete all your subscription
-
rake fb:rt:subscribe to add or a modify a subscription
-
params
-
object
-
facebook object name eg : user, …
-
-
fields:
-
list of fields with ‘,’ as separator eg : “likes, info”
-
-
callback_url:
-
url bringing to your check method
-
-