I''m trying to figure out how to make only a single controller and/or view be a facebook application. My goal is that I have a normal site, but at some point want to let the user add my application to FB. I used www.ping.fm a few days ago and they do this perfectly with Facebook. Any tips? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080910/33f5092b/attachment.html>
Sure, use routing to only make one controller available through Facebook. You can use :conditions=>{:canvas=>true} to set a different default route for Facebook. Then, you should be okay as long as you only link to things you want the user to see. If you are super paranoid, you can add a filter around the rest of your controllers that stops the request if it is from a facebook canvas. Mike On Sep 10, 2008, at 10:00 AM, William Thomas wrote:> I''m trying to figure out how to make only a single controller and/or > view be a facebook application. My goal is that I have a normal > site, but at some point want to let the user add my application to > FB. I used www.ping.fm a few days ago and they do this perfectly > with Facebook. Any tips? > > Thanks! > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
I''m having a terrible time figuring this out. I think I am missing something key to the entire workings of Facebooker. I''ve created a sample application to test things out and am failing miserably. When I try to access a controller that requires the app installed I am sent to facebook allowed to authorize the app and then get the message below. What I believe should happen is the facebook_aware/index.fbml.erb file should be displayed. " Error while loading page from facebookSandbox The URL http://localhost:3000/facebook_aware/?auth_token=[this is really the auth token]&installed=1 is not valid. There are still a few kinks Facebook and the makers of facebookSandbox are trying to iron out. We appreciate your patience as we try to fix these issues. Your problem has been logged - if it persists, please come back in a few days. Thanks! " here are what I believe are the relavent pieces of my app routes.rb: map.connect ''facebook_aware'',:controller => "facebook_aware", :conditions => {:canvas => true} development: ? canvas_page_name: facebook_aware ? callback_url: http://localhost:3000/facebook_aware/ facebook_aware_controller.rb: class FacebookAwareController < ApplicationController ? ? before_filter :ensure_application_is_installed_by_facebook_user ? before_filter :ensure_authenticated_to_facebook ? before_filter :ensure_has_status_update, :only => [:add_status_update] ? ? def add_status_update ??? redirect_to :action => ''done'' ? end ? ? end (map.root) index.html.erb: This is where I ask the user to "add" the facebook component <%= link_to "Use Facebook" , {:controller => "facebook_aware",:action => "index" } %> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080916/c12703e6/attachment.html>
What is your canvaspath in Facebook? It can''t use localhost because Facebook needs to be able to talk to your webserver. You''ll need to open up access to your server. I created the Tunnlr service to make this easy (http://tunnlr.com) Check out http://www.pragprog.com/titles/mmfacer for my book on Facebook development. I know there is one By from peepcode as well. Mike On Sep 16, 2008, at 4:53 PM, William Thomas wrote:> I''m having a terrible time figuring this out. I think I am missing > something key to the entire workings of Facebooker. I''ve created a > sample application to test things out and am failing miserably. > > When I try to access a controller that requires the app installed I > am sent to facebook allowed to authorize the app and then get the > message below. What I believe should happen is the facebook_aware/ > index.fbml.erb file should be displayed. > > " > Error while loading page from facebookSandbox > > The URL http://localhost:3000/facebook_aware/?auth_token=[this is > really the auth token]&installed=1 is not valid. > > There are still a few kinks Facebook and the makers of > facebookSandbox are trying to iron out. We appreciate your patience > as we try to fix these issues. Your problem has been logged - if it > persists, please come back in a few days. Thanks! > " > > here are what I believe are the relavent pieces of my app > > routes.rb: > map.connect ''facebook_aware'',:controller => > "facebook_aware", :conditions => {:canvas => true} > > development: > canvas_page_name: facebook_aware > callback_url: http://localhost:3000/facebook_aware/ > > facebook_aware_controller.rb: > class FacebookAwareController < ApplicationController > > before_filter :ensure_application_is_installed_by_facebook_user > before_filter :ensure_authenticated_to_facebook > before_filter :ensure_has_status_update, :only => > [:add_status_update] > > def add_status_update > redirect_to :action => ''done'' > end > > end > > (map.root) index.html.erb: > This is where I ask the user to "add" the facebook component > <%= link_to "Use Facebook" , {:controller => > "facebook_aware",:action => "index" } %> >-- Mike Mangino http://www.elevatedrails.com
In facebook its callback url : http://localhost:3000/facebook_aware/ canvas_page: http://apps.facebook.com/facebook_aware/ I can try having the callback point to a domain on the internet easy to do, I already have no-ip running @ home... hopefully that will be my only problem. Is it right that I use :conditions => {:canvas => true} for my facebook_aware controller? The goal is to have that controller only exist in a Facebook canvas so I can redirect a user to that controller, and then have facebook take over asking them permissions, etc so my website can do things like query friends and post updates --- On Tue, 9/16/08, Mike Mangino <mmangino at elevatedrails.com> wrote: From: Mike Mangino <mmangino at elevatedrails.com> Subject: Re: [Facebooker-talk] FB Canvas Controller To: wthomas989 at yahoo.com Cc: facebooker-talk at rubyforge.org Date: Tuesday, September 16, 2008, 4:52 PM What is your canvaspath in Facebook? It can''t use localhost because Facebook needs to be able to talk to your webserver. You''ll need to open up access to your server. I created the Tunnlr service to make this easy (http://tunnlr.com) Check out http://www.pragprog.com/titles/mmfacer for my book on Facebook development. I know there is one By from peepcode as well. Mike On Sep 16, 2008, at 4:53 PM, William Thomas wrote:> I''m having a terrible time figuring this out. I think I am missing > something key to the entire workings of Facebooker. I''ve created a > sample application to test things out and am failing miserably. > > When I try to access a controller that requires the app installed I > am sent to facebook allowed to authorize the app and then get the > message below. What I believe should happen is the facebook_aware/ > index.fbml.erb file should be displayed. > > " > Error while loading page from facebookSandbox > > The URL http://localhost:3000/facebook_aware/?auth_token=[this is > really the auth token]&installed=1 is not valid. > > There are still a few kinks Facebook and the makers of > facebookSandbox are trying to iron out. We appreciate your patience > as we try to fix these issues. Your problem has been logged - if it > persists, please come back in a few days. Thanks! > " > > here are what I believe are the relavent pieces of my app > > routes.rb: > map.connect ''facebook_aware'',:controller => > "facebook_aware", :conditions => {:canvas => true} > > development: > canvas_page_name: facebook_aware > callback_url: http://localhost:3000/facebook_aware/ > > facebook_aware_controller.rb: > class FacebookAwareController < ApplicationController > > before_filter :ensure_application_is_installed_by_facebook_user > before_filter :ensure_authenticated_to_facebook > before_filter :ensure_has_status_update, :only => > [:add_status_update] > > def add_status_update > redirect_to :action => ''done'' > end > > end > > (map.root) index.html.erb: > This is where I ask the user to "add" the facebook component > <%= link_to "Use Facebook" , {:controller => > "facebook_aware",:action => "index" } %> >-- Mike Mangino http://www.elevatedrails.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080916/3a270520/attachment-0001.html>
On Sep 16, 2008, at 6:03 PM, William Thomas wrote:> In facebook its > callback url : http://localhost:3000/facebook_aware/ > canvas_page: http://apps.facebook.com/facebook_aware/ > > I can try having the callback point to a domain on the internet easy > to do, I already have no-ip running @ home... hopefully that will be > my only problem.Facebook will need to be able to talk to your local mongrel, so you''ll need no-ip and a hole in your firewall> > > Is it right that I use :conditions => {:canvas => true} for my > facebook_aware controller? The goal is to have that controller only > exist in a Facebook canvas so I can redirect a user to that > controller, and then have facebook take over asking them > permissions, etc so my website can do things like query friends and > post updates >You shouldn''t even need to do that. Requiring facebook install should be enough. Mike> --- On Tue, 9/16/08, Mike Mangino <mmangino at elevatedrails.com> wrote: > From: Mike Mangino <mmangino at elevatedrails.com> > Subject: Re: [Facebooker-talk] FB Canvas Controller > To: wthomas989 at yahoo.com > Cc: facebooker-talk at rubyforge.org > Date: Tuesday, September 16, 2008, 4:52 PM > > What is your canvaspath in Facebook? It can''t use localhost because > Facebook needs to be able to talk to your webserver. You''ll need to > open up access to your server. I created the Tunnlr service to make > this easy (http://tunnlr.com) > > Check out http://www.pragprog.com/titles/mmfacer for my book on > Facebook development. I know there is one By from peepcode as well. > > Mike > > On Sep 16, 2008, at 4:53 PM, William Thomas wrote: > > > I''m having a terrible time figuring this out. I think I am missing > > something key to the entire workings of Facebooker. I''ve created a > > sample application to test things out and am failing miserably. > > > > When I try to access a controller that > requires the app installed I > > am sent to facebook allowed to authorize the app and then get the > > message below. What I believe should happen is the facebook_aware/ > > index.fbml.erb file should be displayed. > > > > " > > Error while loading page from facebookSandbox > > > > The URL http://localhost:3000/facebook_aware/?auth_token=[this is > > really the auth token]&installed=1 is not valid. > > > > There are still a few kinks Facebook and the makers of > > facebookSandbox are trying to iron out. We appreciate your patience > > as we try to fix these issues. Your problem has been logged - if it > > persists, please come back in a few days. Thanks! > > " > > > > here are what I believe are the relavent pieces of my app > > > > routes.rb: > > map.connect ''facebook_aware'',:controller => > > "facebook_aware", :conditions => {:canvas => > true} > > > > development: > > canvas_page_name: facebook_aware > > callback_url: http://localhost:3000/facebook_aware/ > > > > facebook_aware_controller.rb: > > class FacebookAwareController < ApplicationController > > > > before_filter :ensure_application_is_installed_by_facebook_user > > before_filter :ensure_authenticated_to_facebook > > before_filter :ensure_has_status_update, :only => > > [:add_status_update] > > > > def add_status_update > > redirect_to :action => ''done'' > > end > > > > end > > > > (map.root) index.html.erb: > > This is where I ask the user to "add" the facebook component > > <%= link_to "Use Facebook" , {:controller => > > "facebook_aware",:action => "index" } %> > > > > -- > Mike Mangino > http://www.elevatedrails.com > > > >-- Mike Mangino http://www.elevatedrails.com