Jul 30, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Ref handles randomly failing

Hey Mike,

I just extensively tested the ref handles in my app. I find that few times the fb:ref handles fail – I get an error from Facebook that the fb:ref was not set. If I do a page refresh in my browser the error goes away. Is it an isolated problem, or have you noticed this in your app too?

Thanks.

 
Jul 25, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / actions that don't require sessions

Thanks for the update. Someone pointed out to the new api on the forums. The post is here: http://forum.developers.facebook.com/viewtopic.php?pid=90944
I couldn’t check but he seems to think that we can do Batch.run without a session now.

Thanks,

Ram

 
Jul 25, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Possible error in using memcached?

I am using cache_fu and it has a :find_by setting which when set to facebook_id resolved my problem.

 
Jul 25, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / actions that don't require sessions

Looks like batch.run still requires session. What’s the best way to run batch jobs in the background? I used to use my personal facebook account user “infinite key”, but seems like it is not really infinite. I get random session timed out errors thrown at me from my background jobs.

Thanks.

 
Jul 24, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / actions that don't require sessions

Hey Mike,

I know you are working hard on a new beta release soon, but would it be possible to give us a quick example of how to use batch requests and setRefHandle without the session keys? I am sort of stalled here.

Thanks.

 
Jul 24, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / checking if a session is valid

should my timezone be set to something specific by the way?

 
Jul 24, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Possible error in using memcached?

I’ll try that.

 
Jul 24, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / checking if a session is valid

Hey,

How do I check if the session of a user in the database is valid?

u = User.find(1)
u.facebook_session.user.uid throws *Facebooker::Session::SessionExpired: Session key invalid or no longer valid*
But u.facebook_session.expired? returns false
 
Jul 21, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Possible error in using memcached?

Hey Mike,

The book says in page 160 to use

def cache_id(cache_id) 
cache_id 
end 

to use facebook_id instead of the id as the key in memcache.

But, when I use the code as is, I observe that my cache has two key-value pairs:
id => active_record
fb_uid => active_record. (This is created by User.for(...) on first call)

To verify this, I did the following:
u = User.find(1)
User.get_cache(1) == User.get_cache(u.facebook_id) (returns true

Am I missing something?

 
Jul 16, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / infinite sessions in old profile

Hey,

For the new profile, we can request users to add infinite_sessions by setting promptpermission in the form. How do we do this for the old profile? promptpermission does not seem to work for the old profile.

Thanks.

 
Jul 15, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / redirect_to not preserving the base url

Fix pastied here: http://pastie.org/233585

 
Jul 15, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / redirect_to not preserving the base url

I notice that when I do a redirect_to from one action to another in the controller “fb_sig_in_new_facebook” does not get passed along. Is there anyway to fix this before the next release of the api?

Thanks

 
Jul 14, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / syntax error in user.rb

use the git version if you haven’t resolved this problem.

 
Jul 14, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Why not use facebook_id as the main key in the user table?

Yes, it does. But, you should denormalize your tables, and store facebook_id in addition to user_id in the photos table.

 
Jul 14, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Template Missing with ensure_authenticated_to_facebook

Got it. That was it. Thanks.

 
Jul 13, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / equivalent of require_login

Am I correct in assuming that ensure_authenticated_to_facebook is the rails way of doing require_login that facebook now requires?

Thanks.

 
Jul 13, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / cookie-based session store

The secret key should just be constant (it is used to decode the encrypted cookies). It doesn’t (and shouldn’t) match the one in the book.
I have the cookie-based session store working fine (and just like the db-stored).

If you are switching session stores, make sure to flush your session table in your db before the switch.

 
Jul 13, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Why not use facebook_id as the main key in the user table?

Google “surrogate keys” if you haven’t. But, the short answer is it is better to have the surrogated key because:

1) Rails is opinionated
2) If you were to integrate opensocial and facebook later down the road – it is much easier.
3) In some databases, it is more efficient to insert the primary key in an ordered manner.

Of course, nothing stops you from setting pk to the fb ids.

 
Jul 11, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Template Missing with ensure_authenticated_to_facebook

Hi,

I switched from ensure_application_is_installed_by_facebook_user to ensure_authenticated_to_facebook. I have a strange problem now.

If the user is already logged in to Facebook my index page renders correctly.
But, if he goes to my app without being logged in to Facebook, then he is redirected to Facebook to login. After logging in to Facebook, he gets redirected to my website which throws the following error.


Template is missing
Missing template friend/index.html.erb in view path /Users/...

One thing to note is that my view is defined as friend/index.fbml.erb and the above points to friend/index.html.erb.

Anyone seen this before?

Thanks.

 
Jul 8, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / cookie-based session store

I googled and found that to get rid of ActionController::InvalidAuthenticityToken I need to add

protect_from_forgery :only => [:create, :update, :destroy]

to my controller. It’s working for me too now :)

 
Jul 3, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Evented Starling

I was about to post before your I saw your post. I was running into issues during larger tests too, and I initially thought it was just me being up so late. I just switched back to Beanstalkd and cannot be happier. But, on the flip side I don’t have persistence.

Ram

 
Jul 3, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Evented Starling

Hey guys,

For those of you who are using Starling for asynchronous tasks, and evented version is out there in git which is 2x – 4x faster than the gem version.

 
Jul 3, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / Changes between versions?

Thanks. This book has been infinitely useful. So as I understand, for now we will continue using sessions for fbrefs etc. Am I correct?

 
Jul 1, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / cookie-based session store

Actually, after the first attempt it does work. But I get an ActionController::InvalidAuthenticityToken error thrown at me for some of the ajax updates.

 
Jul 1, 2008
Generic-user-small ramkaka 31 posts

Topic: Developing Facebook Platform Applications with Rails / cookie-based session store

Nope. I still get CGI::Session::CookieStore::TamperedWithCookie
Is there something different about the way Facebook sets and gets cookies (I noticed that they have API calls for that).

31 posts

Page: 1 2