Connect with Facebook to Rails Application By Nyros Developer

  • 4,648 views
Uploaded on

Connect with Facebook to Rails Application

Connect with Facebook to Rails Application

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to like this
No Downloads

Views

Total Views
4,648
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
46
Comments
1
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. WELCOME TO RUBY ON RAILS DEVELOPERS
  • 2. An introduction to Facebook Connect Nyros Facebook Developer Garage, May 29 th 2010
  • 3. Requirements for facebook integration
    • Facebooker Gem
    • Facebooker Plugin
    • Facebook Login Details
    • Facebook Developer Application
  • 4.
    • Introduction
    • Uses in real time
    • Implementation & Integration with Rails App
  • 5. Facebook Connect - Introduction
    • What Facebook Connect does:
    • Allow your friend network information to be brought to external websites
    • Allow external website activity to be brought into Facebook
    • Both aspects top priority for Facebook.
  • 6.
    • Traffic
    • Enable over 300MM Facebook users to share your content with their friends on Facebook
    • Engagement
    • Users can immediately find their friends and engage(add as friend).
    • Revenue
    • Boost your revenue. Facebook Connect helps you grow revenue by increasing traffic and user engagement. In addition, better targeting capabilities can improve monetization.
    Facebook Connect - Introduction
  • 7. Use in real time Scribd is a document-sharing website
  • 8.  
  • 9. Use in real time
  • 10. Use in real time
  • 11. News feed in our FB friends wall
  • 12. Implementation & Integration with Rails App
    • Create Rails Application
    • c: > rails connect_facebook
    • c: > gem install facebooker
    • c: >ruby script/plugin install git://github.com/mmangino/facebooker.git
    • or download from github http://github.com/mmangino/facebooker
    • Plugin placed at
    • connect_facebookvendorplugins
  • 13. Implementation & Integration with Rails App
    • Steps for create facebook application
    • http://www.facebook.com/developers/createapp.php
  • 14.  
  • 15.  
  • 16.  
  • 17. Take a note of the api_key and secret and add these to config/facebooker.yml
  • 18. development: api_key: 23ad2f3a4cf6f235b2249dd0138c2913 secret_key: d3570fc4434b5a4ad9e1fc0f29e991c3 canvas_page_name: callback_url: http://localhost:3000/ pretty_errors: true set_asset_host_to_callback_url: true tunnel: public_host_username: public_host: public_port: 4007 local_port: 3000 add these api and secret keys to config/facebooker.yml
  • 19.
    • Javascript tags include at application layout
    <%= javascript_tag &quot;window.xd_receiver_location = '#{ENV['XD_RECEIVER_LOCATION']}';&quot; %> <%= javascript_include_tag 'facebook_require' %> <%= javascript_include_tag 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php' %> or register with Facebook connect <fb:login-button onclick='facebook_button_onclick()'></fb:login-button>
  • 20. Some Connect code: <fb:login-button> </fb:login-button> <script src=&quot;http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php&quot; type=&quot;text/javascript&quot;></script> This loads in the JavaScript library which renders the login button
  • 21.
    • c: > ruby/script/generate xd_receiver
    • xd_receiver is a cross-domain receiver file
    Two different methods for login, in this implementation
  • 22.
    • Create controller
    • c: > ruby script/generate controller fb_connect
    • def authenticate
    • set_facebook_session
    • @facebook_session = Facebooker::Session.create(Facebooker.api_key, Facebooker.secret_key)
    • logger.debug &quot;facebook session in authenticate: #{facebook_session.inspect}&quot;
    • #render :text=>set_facebook_session and return
    • redirect_to @facebook_session.login_url
    • end
  • 23. Enter here out facebook login details
  • 24. A Facebook styled dialogue box lets the user know what’s going on
  • 25.  
  • 26.
    • What you can do when you’re “Connect”ed:
    • Display information from Facebook profiles on your own site
    • Publish stories to Facebook from your site
    • Re-create your users’ social graphs
  • 27. Facebook Connect – How it works
    • Quick tech intro:
    • Uses an evolved version of the JavaScript client library:
    • Use FBML within your standard HTML. (They call this XFBML.)
    • Make standard Facebook API calls within the JavaScript library
    • Facebook’s JavaScript XFBML library populates FBML tags on your site with profile data
  • 28.
    • What you can’t do:
    • Publish stories to a friends newsfeed, only to the current user’s
    • Update any profile box except that of the current user
  • 29. Facebook Connect – Disadvantages There are disadvantages to Facebook Connect…
  • 30. Facebook Connect – Disadvantages
    • It’s all in JavaScript:
    • Not always the most manageable code
    • Takes some lateral thinking to hook up with your site’s databases
    • No SEO benefits
    • Poor accessibility (JavaScript disabled = Facebook Connect doesn’t work)
  • 31. Facebook Connect – Disadvantages
    • It’s not a treasure-trove of new user details:
    • Can’t access any more friend details than if a user adds an application i.e. no access to e-mail addresses
    • Facebook intends privacy settings to be dynamic, therefore changes in Facebook settings may affect your site
    • You don’t own the data
  • 32. Facebook Connect – The future Thanks Ratnam Raju, [email_address]