Generic-user-small Ram Ravichan... 3 posts

Hey,

First off, I wanted to thank you, Mike for taking time to answer our queries. It’s very hard to find authors who actually help their readers.

So, I am trying to send notifications to people using the Publisher. I am trying to send the messages in an asynchronous process (so I cannot use current_user). Facebooker requires that the from address is a real user.

def error_notification(from_user, to_user, url)
  send_as :notification
  recipients to_user
  from from_user.facebook_session.user 
end
fbml <<-MESSAGE
      <fb:fbml>
      Here is the link to the error notification #{url} !!!
      
Thanks
</fb:fbml> MESSAGE

This gives me:

Facebooker::Session::SessionExpired (Session key invalid or no longer valid): /vendor/plugins/facebooker/lib/facebooker/parser.rb:386:in `process’ /vendor/plugins/facebooker/lib/facebooker/parser.rb:15:in `parse’ /vendor/plugins/facebooker/lib/facebooker/service.rb:13:in `post’ /vendor/plugins/facebooker/lib/facebooker/session.rb:399:in `post’ /vendor/plugins/facebooker/lib/facebooker/session.rb:268:in `send_notification’ /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:158:in `send_message’ /vendor/plugins/facebooker/lib/facebooker/rails/publisher.rb:237:in `method_missing’ /app/controllers/cart_controller.rb:362:in `send_error_notification’
....
....

I think the session that gets stored in the user table isn’t infinite. How do I send notifications in an offline setting?

Thanks,

Ram

 
Generic-user-small Ram Ravichan... 3 posts

The code seems to have been mucked up by the editor :(

def error_notification(from_user, to_user, url)
  send_as :notification
  recipients to_user
  debugger
  from from_user.facebook_session.user 
  fbml <<-MESSAGE
        <fb:fbml>
        Here is the link to the error notification #{url} !!!
        Thanks
</fb:fbml> MESSAGE end

2 posts, 1 voice