Import friends

8 views
Skip to first unread message

daynthan kabilan

unread,
May 30, 2013, 1:32:37 AM5/30/13
to rubyonra...@googlegroups.com
Hi friends,

I need send invitation to my facebook friends. i can import all my facebook friends. but when i send a message to particular user this message send all my friends. how can i solved it. Please help me.

this is my code

def facebook_invite
    friend_id= params[:mail]
    logger.debug('CURRENT')
    logger.debug( current_user.authentications[0]['token'] )
    if( access_token = current_user.authentications[0]['token'] )
      @graph = Koala::Facebook::GraphAPI.new(access_token)
      @graph.get_connections("me", "mutualfriends/#{friend_id}")
      begin
        @graph.put_object("me", "feed", :message => "hi, #{current_user.user_name} has sent you request to join my project.")
      rescue
        flash[:alert] = "Already Posted"
      end
      logger.debug( 'FRIENDS' )
      logger.debug( @friends )
    end
  end

Thanks for advance
Reply all
Reply to author
Forward
0 new messages