views:

170

answers:

2

I'm using rfacebook gem to interact with facebook connect. And I'm having a problem with uploading images. As facebook api says, the data should be transferred in a hash like json object. So I'm making an hash

      publish_values = {
        :uid => @post.profile.channel_uid,
        :message => @post.content,
        :auto_publish => true,
      }


      unless @post.message.skip_link_info
        publish_values[:attachment] = {}
        publish_values[:attachment][:name] =  @post.message.link_title unless @post.message.link_title.blank?
        publish_values[:attachment][:caption] = @post.message.link_title unless @post.message.link_title.blank?
        publish_values[:attachment][:description] = @post.message.link_description unless @post.message.link_description.blank?
        unless @post.message.no_thumbnail || @post.message.link_image_url.blank?
          publish_values[:attachment][:media] = [{ :type => 'image', :src => @post.message.link_image_url, :href => @post.short_uri }]
        end
      end

But It's not uploading any image to the facebook, the xml respons says "properties must be a dictionary". So I'm stuck in here for a couple days It doesn't make any sene

A: 

My understanding is that rFacebook is no longer actively supported and facebooker is the Ruby>Facebook library of choice. Might find better support ...

Toby Hede
A: 

As Toby mentioned, you should strongly consider switching to Facebooker. rFacebook has not been under active development for a long time now.

However I believe the reason for the error in your example is that you are missing the 'properties' field.

Here is the documentation on stream publish: http://wiki.developers.facebook.com/index.php/Attachment_%28Streams%29

As you can see, one of the required values is a 'properties' hash.

You will likely need to add a line like this to your code (either empty or containing the appropriate values per the documentation):

publish_values[:attachment][:properties] = { }

Good luck!

Gdeglin