Facebook app invites with RoR 8
Ray and I spent quite a while to get everything in our Facebook app to work. There were some blog posts about how get invites to work but they are outdated (and they involve some nasty FQLs).
One thing that I did was to create a beta fb application to test all this stuff out with our beta server, this helps a lot.
So in case you’re going crazy adding invites to your fb app, here’s how we did it. Keep in mind that the fb platform changes rapidly so by the time you read this there is probably a better way to do invites.
In your canvas partial, add a link to http://apps.facebook.com/[yourappname]/invite
here’s how our invite method looks like:
def invite
@appname = ENV['RAILS_ENV'] == 'production' ? 'onmylist' : 'onmylist_beta'
@appid = ENV['RAILS_ENV'] == 'production' ? 12345678 : 01234567
if fbsession.is_valid?
@friends2exclude = fbsession.friends_getAppUsers.uid_list
end
render :partial => "select_fbml"
end
note: app id’s are not real! :)
Here’s the select_fbml partial:
<fb:fbml>
<fb:subtitle>Invite your friends to join OnMyList</fb:subtitle>
<div style="background-color:#f2fbdc;padding-bottom:0;margin-bottom:0">
<% join_button = CGI::escapeHTML "<fb:req-choice url='http://www.facebook.com/apps/application.php?id=#{@appid}' label='Join OnMyList'>" %>
<fb:request-form
method="POST"
invite="true"
type="OnMyList"
action="http://apps.facebook.com/<%= @appname %>/"
content="Let's join OnMyList so you can list your pants off! <%= join_button %>">
<fb:multi-friend-selector
rows="5"
exclude_ids="<%= @friends2exclude.join(',') %>"
showborder="false"
actiontext="Here are your friends who don't have OnMyList. Invite them now!">
</fb:request-form>
</div>
</fb:fbml>
the exclude_ids param is to exclude your friends who already have the app installed.
Trackbacks
Use the following link to trackback from your own site:
http://blog.onmylist.com/articles/trackback/25
-
If you’re interested in getting invites to work with your Facebook app in Ruby on Rails, I just wrote up a quick howto at the OML blog. Technorati Tags: facebook, Rails, RoR, ruby, rubyonrails ...
-
We have spent the last 2 days to fix, improve, clean up the OnMyList facebook app. There is this new way of using FBML to do invitations. I figure it will help some other folks out as well. If you are looking to spread some viral on facebook, take...
-
Finally a Site that pays YOU,Make Money Online
-
Law degree 6 years. Conservation law enforcement degree online courses. Law enforcement college degree. Law degree. Online mba law degree.
-
resources
-
resources
-
Copier paper. Canon pc720 copier. Copier company mission statement. Cd copier free software. Magic dvd copier. Onhar slide copier. Dvd copier. Cd copier.
-
very intresting stuff to read
-
Eli lilly atomoxetine hci. Eli lilly atomoxetine.
-
Buy cialis. Cialis discount american pharmacy. Cialis best price buy online. Cialis viagra levitra. Cheapest generic cialis. Purchase cialis online. Cialis lawyer columbus. Cialis.
-
Rape stories. Lesbian rape stories. Rape fantasy story. Real rape. Teen rape. Rape movies.
-
Free xxx. Free xxx pictures. Xxx free video clips.
Comments
-
Hey, Great code piece, it helps a lot. I have a quick question. Do you know if its possible to extract the number of invited users and use that in your rails app? Thanks, Charlie - rcwhite@colby.edu
-
I don't think so, because Facebook handles the actual invitation. We used the above code to generate and present the invitation page in Facebook. After the user selects friends to invite and Facebook sends the invitations, the user is redirected to the canvas page, I believe.
-
I’ve having the same problem as fs above. I get an 500 -Internal Server Error and the stack trace leads back to require “facebook_rails_controller_extensions”. Does anyone have any idea what that is about?
-
vizarded trivia cubiform caza nonabstemious uncorruptive enlargeableness requench http://www.timkoenning.com/ >American Wealth Management, Inc. http://www.hamiltonrescue.org/
-
vizarded trivia cubiform caza nonabstemious uncorruptive enlargeableness requench http://www.tente.com/ >Tente-Rollen GmbH & Co. http://www.liverpool-community.org.uk/
-
bj6ujv4gijle0izz
-
kwynzszjwdjbqoedwell, hi admin adn people nice forum indeed. how's life? hope it's introduce branch ;)
-
Hello, Great code piece .Really it works.. Thanks